Created
October 20, 2021 10:44
-
-
Save velotiotech/5fc6b2b55a2cd82886acf2a99c323467 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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