socketio / socketio/socket.io

Getting error websocket.js:39 WebSocket connection to 'ws://localhost:3000/socket.io/?EIO=4&transport=websocket' failed: again and again

Open
#5,027 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs investigation
Dominant language
TypeScript
Stars
63.2k
Forks
10.3k
Avg merge
11d 20h
Merged PRs (30d)
2

Description

Hello i am using socket.io-client package in my frontend react project this is my frontend code
image
and in backend my code is setup in node js this is my node js code so initially socket gets connected and prints in console "user is connected" then after sometime it shows error in console in loop
image

image
image
image

Can you please tell me why this error is coming thanks @darrachequesne @maccman

Contributor guide

Open the contributing guide

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 with the browser console location websocket.js:39 and the React client and Node.js server snippets shown in the issue. Reproduce the repeated connection attempt using the listed ws://localhost:3000/socket.io/?EIO=4&transport=websocket URL, then compare client and server output. Done means identifying the cause of the disconnect and documenting a reproducible resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, react, typescript
Domain
full-stack, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.