Sticky sessions not working when using Primus.createSocket - using engine.io transfomer
See original GitHub issueVersion: 5.0.1
Server Environment:
- Operating system: Debian wheezy
- Browser: no
- Node.js: 4.2.2
- Transformer: engine.io 1.6.8
Client Environment:
- Operating system: OSX 10.10.5
- Browser: no
- Node.js: 4.2.2
- Transformer: engine.io 1.6.8
Expected result: when using the primus client from node ( via Primus.createSocket ) it should handle sticky sessions over haproxy loadbalancer the same way as the browser client
Actual result: If I run two instances of primus on a remote server (lets say on port 1112 and 1113), behind a haproxy, the browser client connects to the instance, where the haproxy directs it, (lets say it connects to 1112) and it stays there, the sticky session is working
If I do the same from node, using Primus.createSocket, I can see the connection starts on one instance ( on port 1112) then the second or third, or nth packet hits the other instance ( on port 1113) and the client receives an error:
[Error: xhr poll error] type: 'TransportError', description: 400
This cannot be reproduced using the “websockets” transformer, so I’m unsure if it’s directly engine.io related.
Steps to reproduce: run two instances, with engine.io behind a haproxy, and try to connect them from node using Primus.createSocket
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
I’ve put my workaround in a module if anyone needs it in the future
https://github.com/necccc/primus-headless-cookie
Ok, thanks for the update. I close this, please post back if needed.