Created
July 2, 2018 16:28
-
-
Save claytonbez/9638e3d7d06670d93b416fb6bbb6ca5a to your computer and use it in GitHub Desktop.
Socket.io Client example for NodeJS
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
var io = require('socket.io-client'); | |
var connectData = { server:"http://127.0.0.1:80"} | |
var socket = io.connect(connectData.server); | |
socket.on('connect',function(){ | |
console.log('Connected to main Server'); | |
}); | |
socket.on('disconnect',function(){ | |
console.log('Connected to main Server'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment