Node.js with Socket.io - Long Polling fails and throws “code”:1,“message”:“Session ID unknown” response -


please give solution- socket polling requests failing following error.

{"code":1,"message":"session id unknown"} 

?eio=3&transport=polling&t=lqtr6rn&sid=0jfgcefndrs-xbzxhaxm, long poll call client makes server, if see here passing sessionid, node identifies socket connection request has been made , responds.

but in cases, dealing multiple nodes/amazon elb call may go other node didn't generate sessiois, in case node not able identify sessionid call made , hence responds {"code":1,"message":"session id unknown"}

you see error in case of long polling not getting answered or getting timeout.

nginx

you need ip_hash in upstream server definition , headers.

socketio nginx configuration (using multiple nodes)

amazon elb

for having issue behind amazon elb, make sure enable application-controlled session stickiness


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -