When connection fails, it will still try and connect to Pusher (over XHR) as a fallback.
More specifically to http://sockjs.pusher.com/pusher/app/.... Did I forget to change something in my config/echo/etc. files or is this expected behavior for now?
Yeah, that's how the Pusher JS client handles this.
By default it will try to connect via WebSocket and will fallback to use polling XHR requests.
You can disable this by forcing the pusher client to only use websocket connections like this:
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
wsHost: window.location.hostname,
wsPort: 6001,
disableStats: true,
enabledTransports: ['ws', 'wss'] // <-- only use ws and wss as valid transports
});
This would be great to add to the documentation. Thanks for the fix.
Most helpful comment
Yeah, that's how the Pusher JS client handles this.
By default it will try to connect via WebSocket and will fallback to use polling XHR requests.
You can disable this by forcing the pusher client to only use websocket connections like this: