Skip to content

@mrryanjohnston /gist:4324576
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
var express = require('express')
, app = express()
, server = require('http').createServer(app)
, io = require('socket.io').listen(server);
/**
* Http Server.
*/
app.use(express.static(__dirname + '/public'));
app.use(app.router);
app.get('/', function(req, res) {
res.sendfile(__dirname + '/index.html');
});
server.listen(8080);
/**
* Socket.io stuff.
*/
io.sockets.on('connection', function(socket) {
// ...
emitter.on('stats', function(stream) {
socket.broadcast.emit('stats', stream);
});
});
io.set('log level', 1);
<script src="/socket.io/socket.io.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.