Skip to content

Instantly share code, notes, and snippets.

@amckinley
Created September 2, 2016 19:57
Show Gist options
  • Save amckinley/621e5cf7039b69b5eec7086edd0a2bd0 to your computer and use it in GitHub Desktop.
Save amckinley/621e5cf7039b69b5eec7086edd0a2bd0 to your computer and use it in GitHub Desktop.
//server.js
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
io.on('connection', function (socket){
console.log('connection made');
socket.on('CH01', function (from, msg) {
console.log('MSG', from, ' saying ', msg);
});
socket.on('test', function (from, msg) {
console.log("we got test");
});
});
http.listen(3000, function () {
console.log('listening on *:3000');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment