question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Socket.IO v3.0 support

See original GitHub issue
  • Echo Version: 1.9.0
  • Laravel Version: 8.x
  • PHP Version: 7.4
  • NPM Version: 6.14.6
  • Node Version: 12.18.3

Description:

After updating Socket.IO to v3.0.1 there are constant erros of Bad handshake method.

image

{"code":2,"message":"Bad handshake method"}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:26 (14 by maintainers)

github_iconTop GitHub Comments

9reactions
xiCO2kcommented, Nov 18, 2020

Got it working without any problems:

With this JS:

import Echo from "laravel-echo"

window.io = require('socket.io-client');

window.Echo = new Echo({
    broadcaster: 'socket.io',
    host: window.location.hostname + ':6001',
    withCredentials: true
});

For the server I cloned the laravel-echo-server repo, upgraded to the version 3.0.1 and just set this settings on the laravel-echo-server.json file:

"socketio": {
    "cors": {
        "origin": "http://localhost",
        "credentials": true
    }
}

All Worked well both public and private channel.

5reactions
driesvintscommented, Mar 30, 2021

We’ve decided we won’t be investing time anymore into Socket.io since we don’t maintain the laravel-echo-server package. Instead we recommend to use something like https://github.com/beyondcode/laravel-websockets. Sorry for this and thank you for understanding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating from 2.x to 3.0 - Socket.IO
0, the v3 server is now able to communicate with v2 clients. More information below. A v3 client is still not be able...
Read more >
Migrating from 3.x to 4.0 - Socket.IO
Ensure compatibility with Swift v15 clients​. Before version 16.0.0, the Swift client would not include the EIO query parameter in the HTTP ...
Read more >
Socket.IO 3 Release
We are happy to announce the release of Socket.IO v3! Migration guide​. This release contains a few non backward compatible changes.
Read more >
Client API - Socket.IO
This is documentation for Socket.IO 3.x, which is no longer actively maintained. For up-to-date documentation, see the latest version (4.x).
Read more >
Socket.IO 3.1.0
Hello everyone! We just published a new version of Socket.IO: 3.1.0. In order to ease the migration to Socket.IO v3, the v3 server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found