Created
March 1, 2019 15:49
-
-
Save fabiobusnello/b8f8bf8f26ccbbe85ca6e270cfe9d5d1 to your computer and use it in GitHub Desktop.
client webSocket javascript
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
const socket=new WebSocket('ws://localhost:3000/seuToken') | |
socket.onerror = error=>console.log(error) | |
socket.onclose = closeData=console.log(closeData) | |
socket.onmessage = ({data})=>console.log(data) | |
socket.send('minha mensagem') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment