lukeed / lukeed/sockette

Put an option to always reconnect, no matter what

Open
#70 0 comments 2 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.