Skip to content

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

@gigitalz

Description

@gigitalz

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);
  }            
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions