Reputation: 629
We are having some problems when trying to connect socket.io
to a node.js
compute engine
instance through google load balancing
.
If I connect from my browser directly to the external IP
of my node.js
everything works fine.
If I try to connect to this same node.js
through the load balancing
(which will be the production architecture), the socket
keeps disconnecting all the time.
We tried to configure Load Balancing with sessionAffinity without success.
Any tips? Thanks
Upvotes: 7
Views: 1383
Reputation: 3266
By Default The timeout set for http load balancing is 30 seconds by default (Source), this applies to web sockets which in turn is used by socket.io when the protocol is supported by the back-end. Therefore you need to do the following to increase the time out (Source).
To configure the timeout setting:
Upvotes: 2