Skip to content

Socket.io Options for Client Socket constructor

Compare
Choose a tag to compare
@eudaimos eudaimos released this 31 Jan 05:39
· 13 commits to main since this release

0.15.0 (2023-01-31)

Features

  • socket.io-client: allow passing options to socket on client (ea0b59c)

‼️ major important api update ‼️

Allows passing the withCredentials: true option (along with all other available options found here) to the creation of a socket on the client (via socket.io-client) happening via the wireTaoJsToSocketIO() function. This specific option is necessary to allow a Load Balancer to manage sticky sessions necessary for deploying socket.io in a cluster to ensure clients send requests back to the same backend server as documented here. Load Balancers use a cookie to handle this and unless withCredentials: true option is set on the socket.io Socket, cookies will not be resent on requests going to a different host.