Last active
March 20, 2019 18:38
-
-
Save karenpeng/44fb812b88d05ae544c6d882f7a9f254 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
// example below is using express and express-ws | |
app.ws('/websocket', (ws, req) => { | |
ws.on('message', (msg) => { | |
if (msg === 'A') { | |
ws.send('9'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment