Created
June 17, 2019 11:47
-
-
Save zedtux/0932fd1dac3c77ad074b02754b05ecef to your computer and use it in GitHub Desktop.
Tester rapidement une WebSocket (Utilisé dans l'article https://blog.zedroot.org/2019/06/17/tester-rapidement-la-connexion-a-une-websocket/)
This file contains hidden or 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
let ws = new WebSocket('wss://ws.domain.eu/cable/', ['actioncable-v1-json']); | |
ws.onopen = () => { console.log('WS Open') }; | |
ws.onerror = (error) => { console.log('WS ERROR:', error) }; | |
ws.onclose = () => { console.log('WS CLOSED') }; | |
ws.onmessage = (message) => { console.log('WS message:', message) }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment