diff --git a/Readme.md b/Readme.md index 46dfc2be28..41f21f6814 100644 --- a/Readme.md +++ b/Readme.md @@ -21,6 +21,25 @@ var io = require('socket.io'); Next, attach it to a HTTP/HTTPS server. If you're using the fantastic `express` web framework: +#### Express 3.x + +```js +var app = express() + , server = require('http').createServer(app) + , io = io.listen(server); + +server.listen(80); + +io.sockets.on('connection', function (socket) { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', function (data) { + console.log(data); + }); +}); +``` + +#### Express 2.x + ```js var app = express.createServer() , io = io.listen(app);