How to authenticate with Node.js/Express + Passport + Websockets? How to authenticate with Node.js/Express + Passport + Websockets? express express

How to authenticate with Node.js/Express + Passport + Websockets?


Then I could authenticate the socket connection however I want. Issue is I have no idea how I would get the express cookie into the stream from the front since javascript cannot access it (HTTP only cookie).

With express-socket.io-session the session auth is done on handshake, and the handshake is a http request, so even if your cookies are http-only it will work. (Tested by myself)