Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created October 20, 2021 10:44
Show Gist options
  • Save velotiotech/5fc6b2b55a2cd82886acf2a99c323467 to your computer and use it in GitHub Desktop.
Save velotiotech/5fc6b2b55a2cd82886acf2a99c323467 to your computer and use it in GitHub Desktop.
ws2.on('open', () => {
console.log('WS2 connected');
const data = {
type: 'subscribe',
topic: 'general'
}
ws2.send(JSON.stringify(data), (err) => {
if(err) {
console.log(`Error occurred while send data ${err.message}`)
}
})
});
ws2.on('message', ( message) => {
console.log(`ws2 IN ${message}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment