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

Put an option to always reconnect, no matter what #70

Open
gigitalz opened this issue Dec 16, 2022 · 0 comments
Open

Put an option to always reconnect, no matter what #70

gigitalz opened this issue Dec 16, 2022 · 0 comments

Comments

@gigitalz
Copy link

gigitalz commented Dec 16, 2022

I had to undo the 1000,1001,1005 exceptions in the onClose method.
Some reverse proxies like Caddy close the ws with 1001 if you stop/start them, it's so it's annoying having to refresh the page at each reboot or simply reverse proxy config change.
Please add an option where you bypass the 1000,1001,1005 check, some application want to keep retrying no matter what.

onclose: e => {
  console.log(`Closed with code: ${e.code}`);
  if (e.code === 1e3 || e.code === 1001 || e.code === 1005) {
    this.ws.reconnect(e);
  }            
},
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

1 participant