Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I Restrict a Client to only use WebSockets as the only transport? #1768

Closed
distracteddev opened this issue Sep 6, 2014 · 3 comments
Closed

Comments

@distracteddev
Copy link

I am trying to scale a socket.io process to multiple dynos on Heroku which doesn't offer sticky-session routing and wanted to get around this issue by using WebSockets as the only transport. Is there any way to do this with 1.1? Also curious if anyone has any information on what the downsides of doing this would be other than losing browser compatibility?

@HolografixFinn
Copy link

AFAIK IE8 and IE9 won't be able to use websockets.
To force your client to use only websocket, in your client code you could use something like:

io.connect("http://your.domain.com", {transports: ['websocket']});

@distracteddev
Copy link
Author

Seems like this will still falllback to using other transports if the Websocket connection fails (or perhaps it tries to use other connection methods first)

@rase-
Copy link
Contributor

rase- commented Oct 3, 2014

@distracteddev it shouldn't be using any other transports when using {transports: ['websocket']}. Does something (like debug output) seem to indicate otherwise?

You should probably limit the transports to only the WebSocket transport on the server too, if your connections will work with them only.

@rauchg rauchg closed this as completed Nov 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants