jfromaniello / passport.socketio

access passport.js authenticated user information from socket.io connection
655 stars 81 forks source link

Can't get this to work on an Azure web app #111

Open p-diogo opened 9 years ago

p-diogo commented 9 years ago

Hello everybody.

So, I have two servers: one serving as a web server/RESTful API and another endpoint which is a socket.io server. The first serves an AngularJS app which connects to the second server. I have CORS enabled, and it works fine on localhost as I send out the session id via socket.io query param. However, it does not on the Azure environment.

From what I could debug, Azure has a IIS behind these web apps and so it messes up all the HTTP Headers. Could that be the reason why it fails to find a session? Please note that it does connect to the server - it is just not able to retrieve the session. I am pretty sure the session_id is being sent correctly as the code works flawlessly when connecting to localhost.

One interesting fact: when testing on my own machine, I must explicitly connect to 127.0.0.1 and not 'localhost', otherwise it fails to retrieve the session data. Weird, hun? Might that be the reason why It does not work on Azure's environment?

Please help!

Pedro