Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save spiritinlife/0a58544cb063b48996a7a1a44985429c to your computer and use it in GitHub Desktop.
Save spiritinlife/0a58544cb063b48996a7a1a44985429c to your computer and use it in GitHub Desktop.
Azure web apps + Mobile socket io client https://github.com/socketio/socket.io-client-java
If you are using Azure web app service or any azure server to host your socketio service and you have more than two instances.
Then in order for all transports in socketio to work and specifically to upgrade from xhr-polling to websockets, you will need
the following:
1) ARRAffinity cookie needs to be enabled. When iis sees this cookie in the request it chooses the requests web server instance. This
is very important for socketio to work since the upgrade to websockets mechanism uses memory as storage and it will not be shared
between instances.
2) Socket.io-client-java needs to be configured to save and send the ARRAffinity cookie. See the librabry in this section
Transports and HTTP Headers. It shows how to read and write to requests and responses that are handled by the lib.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment