News for hackers. Stuff that matters.
Re:Socket.IO 0.6 released by jph on Monday November 01, 2010 @10:59PM (#1859102)
Socket.IO has really impressed me in the past month. That said, some of the documentation is tricky (IMHO) with things like gotchas in the absolute/relative paths, special cases for working within Node.js, etc. If anyone else here is using this new Socket with Node, I'd be interested in comparing notes-- PM me.
Re:Socket.IO 0.6 released by Rauchg on Tuesday November 02, 2010 @12:32AM (#1859286)
One of the goals of this release was to make it as easy as possible to get started.

1) One line to install

npm install socket.io

2) Three lines two use on the server

var io = require('socket.io');

var socket = io.listen(yourHttpServerInstance);

socket.on('connection', function(conn){ conn.on('message', function(msg){ console.log('message from client', msg); }); }

3) Three lines to use on the client

<script src="/socket.io/socket.js"></script> <!-- assuming node serves the HTML too -->

var socket = new io.Socket().connect();

socket.send('my message!');