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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -