Last active
June 28, 2017 12:22
-
-
Save mrsimonemms/6ffdad1e29f19249184688b9eee42c58 to your computer and use it in GitHub Desktop.
Socket IO
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 io = require('socket.io-client'); | |
const socket = io('http://example.com/room/name'); | |
socket | |
.on('connect', (...args) => { | |
// Do something on connection | |
}) | |
.on('event1', (...args) => { | |
// Do something when an event is received | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment