Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error During handshake: Error 4040 #3598

Closed
lanceliamll opened this issue May 14, 2020 · 3 comments
Closed

Error During handshake: Error 4040 #3598

lanceliamll opened this issue May 14, 2020 · 3 comments

Comments

@lanceliamll
Copy link

Console keeps saying
websocket.js:120 WebSocket connection to 'ws://localhost:5000/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 404

Server Side

io.on("connection", (socket) => {
  console.log("New connection joined");

  socket.on("disconnect", () => console.log("User disconnected"));
})

Client Side

  socket = io("http://localhost:5000", { transports: ['websocket'] });
}, [])```

this should work fine right ?

- OS: Windows 10
- browser: Google Chrome
- socket.io version: 2.3.0


@PDROJACK
Copy link

Is your socket port correct?

@hmagrahi
Copy link

It's because socket.io add a / at the end this caused this bug :/

@darrachequesne
Copy link
Member

Closed due to inactivity, please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants