It looks like socket.io.js has parameters that control this.
- tryTransportsOnConnectTimeout - default value - true
- Transport - default value - true
I believe that if the tryTransportsOnConnectTimeout parameter is set to "true", then socket.io will iterate over all transport mechanisms when connected and use the first one that will succeed.
If the Remember Transport option is set to true, the successful transport is stored in a cookie.
In my application, I implemented logic to reconnect when disconnected. I found that I needed to set both parameters above "false" to prevent a return to unwanted transmission. The problem arose because after disconnecting the server can become available at any time (while the client, for example, tried to use polls rather than websites). If this happened, a cookie was set and subsequent connections continued to use unwanted transport.
source share