Pass WebSocket closure code to Socket.IO Server on "transport close" reason
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 63.2k
- Forks
- 10.3k
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 2
Description
Is your feature request related to a problem? Please describe.
We've been working through some connection stability issues with an embedded device with custom Socket.IO client, and I would like to know more information from our Socket.IO 4.7.5 service whenever a Socket.IO client connection is lost due to WebSocket "transport close".
Describe the solution you'd like
For the mainline Socket.IO client-API, the "disconnect" event has an additional "details" parameter that is quite useful. I would like a similar parameter for the server-API. In this "details" parameter, I'd like to be able to retrieve the WebSocket Status Code .
Describe alternatives you've considered
I've considered printing a backtrace each time, and trying to work out what happened from that, but it seems quite intrusive and generates a lot of logging.
Contributor guide
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 tracing the Socket.IO server API handling the WebSocket "transport close" reason and compare it with the client disconnect event's details parameter. Determine where the WebSocket Status Code can be retained and exposed to the server-side disconnect event, then verify that transport-close disconnects provide the requested code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100