Put an option to always reconnect, no matter what
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.5k
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Description
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);
}
},
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by searching for the onClose handling and the 1000, 1001, and 1005 close-code check shown in the issue. Confirm how reconnect decisions are made, then add an option that bypasses those checks and verify that enabling it retries for those codes while existing behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100