Created
September 16, 2016 11:01
-
-
Save jandrieu/da31325e5f20f54e3581ff2aa4dd05bd to your computer and use it in GitHub Desktop.
failing 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
var app = require('express')(); | |
var http = require('http').Server(app); | |
app.listen(configPort, function () { | |
console.log('Config webserver listening on port ' + configPort); | |
}); | |
var io = require('socket.io')(http); | |
app.get('/', function (req, res) { | |
res.sendFile(__dirname + '/public/index.html'); | |
}); | |
app.get('/socket.io/socket.io.js', function (req, res) { | |
res.sendFile(__dirname + '/public/socket.io.js'); | |
}); | |
io.on('connection', function (socket) { | |
console.log('websocket client connected'); | |
socket.emit('welcome', msg); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment