I have followed Jeffrey way\'s tutorial.
Tutorial:
https://laracasts.com/series/real-time-laravel-with-socket-io/episodes/1
this is my index.js
I'm adding this because this comes up first on Google and it took me 2 days to find a solution.
I'm using Node.js and React, with socket.io-client
I was able to make it work by passing a url and a configuration object to the io
namespace.
import io from 'socket.io-client'
const socket = io('http://localhost:3000', {
reconnectionDelay: 1000,
reconnection: true,
reconnectionAttemps: 10,
transports: ['websocket'],
agent: false,
upgrade: false,
rejectUnauthorized: false
});