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

Ability to disable sockjs fallback #54

Closed
sandstrom opened this issue Nov 7, 2013 · 7 comments
Closed

Ability to disable sockjs fallback #54

sandstrom opened this issue Nov 7, 2013 · 7 comments

Comments

@sandstrom
Copy link

We like Pusher, it's awesome!

What's also awesome is that web sockets is supported in the latest version of IE, FF, Chrome, iOS and Android. Hence, we don't need the fallbacks and because of that we can also skip the dependency loading pain.

It would be great if sockjs could be disabled similar to the flash fallback.

var pusher = new Pusher(PUSHER_KEY, { disableFlash: true, disableSockjs: true });

We're doing this right now, which seems to work, but that could change with an update to the client so an option would be great.

Pusher.SockJSTransport.isSupported = function() { return false; };
@pl
Copy link
Contributor

pl commented Nov 11, 2013

I agree, the current solution is far from perfect. In your case, it might be better to whitelist transports than to blacklist them. We might be introducing some new transports and if you just blacklist SockJS and Flash, you might end up with some fallbacks enabled anyway, which is not what you'd really want. Whitelisting WebSockets would work fine in your case and you wouldn't change anything when updating pusher-js.

@sandstrom
Copy link
Author

Sounds good! How do I go about whitelisting them? I cannot find anything in the source (searching for white finds nothing).

@pl
Copy link
Contributor

pl commented Nov 11, 2013

It's not supported, I was thinking whether to replace this issue with implementing a transport whitelist.

@pl
Copy link
Contributor

pl commented Nov 26, 2013

Released today in 2.1.4 (enabledTransports and disabledTransports options). Closing, thanks for the issue.

@pl pl closed this as completed Nov 26, 2013
@sandstrom
Copy link
Author

Awesome! ⛵

(perhaps you should deprecated the disableFlash option, for clarity)

@pl
Copy link
Contributor

pl commented Nov 27, 2013

It will be deprecated in 2.2 and removed in 3.0.

@sandstrom
Copy link
Author

Nice! Just tried 2.1.4, works great!

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

2 participants