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

Wrap websocket instantiation in try/catch to catch IE security errors #844

Closed
mtharrison opened this issue May 24, 2015 · 1 comment
Closed

Comments

@mtharrison
Copy link

IE10/11 will throw a SecurityError when calling new Websocket(url), where url is considered to be an intranet site.

In this situation polling would still with s.io work but it doesn't have a chance because the SecurityError isn't being caught. I propose to wrap https://github.com/Automattic/socket.io-client/blob/master/socket.io.js#L3413 in a try/catch and emit an error on the transport if there is one, causing the transport to be frozen. Polling can then continue:

try {
    this.ws = new WebSocket(uri, protocols, opts);
} catch (e) {
    return this.emit('error', e);
}
@darrachequesne
Copy link
Member

Closed by socketio/engine.io-client#475. Thanks for the report.

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