• in Javascript

    When building a WebSocket-based application using express.js and socket.io, one of the main problems to resolve is how to go about connecting express' session management with that of socket.io.


    Prior to socket.io 0.7, there were a few different hacks that could be used, but that release fortunately brought a saner approach to the table. Daniel Baulig wrote a very thorough blog post that discusses exactly this issue, with detailed code snippets showing precisely the steps that are required.


    It was a big help for me getting session management working in socket.io this weekend, so I recommend anyone else that needs to deal with the same issue gives it a read.


    http://www.danielbaulig.de/socket-ioexpress
    • socket.io and Express. Tying it all together. | blinzeln

      Express is a great web development framework for node.js. It provides easy access to stuff like routing, requests and sessions. socket.io is an abstraction layer for Websockets, with Flash and XHR fallbacks, that runs in both node.js and the client. The Basics You can have socket.io run with Express easily.