-
Notifications
You must be signed in to change notification settings - Fork 194
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 auto reconnect? #100
Comments
It is not documented, but reading the source code we can see this bit: this.scope = options && options.scope || $rootScope;
this.rootScopeFailover = options && options.rootScopeFailover && true;
this.useApplyAsync = options && options.useApplyAsync || false;
this.initialTimeout = options && options.initialTimeout || 500; // 500ms
this.maxTimeout = options && options.maxTimeout || 5 * 60 * 1000; // 5 minutes
this.reconnectIfNotNormalClose = options && options.reconnectIfNotNormalClose || false;
this.binaryType = options && options.binaryType || 'blob'; So yeah, just call it like this: $websocket("ws://localhost:8337", null, { reconnectIfNotNormalClose: true }); |
Thanks!! |
Great! You saved my day dear ;-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I came from ng-websocket (https://github.com/wilk/ng-websocket) in which you can simply do:
var ws = $websocket.$new('ws://localhost:12345', true);
The true makes it auto-reconnect when there's a failure. How can I create the same in this project?
The text was updated successfully, but these errors were encountered: