I'm working on a Laravel project that uses Laravel Echo for real-time event broadcasting. Recently, when I load my application in Firefox, I see the following error in the browser console:
Firefox can’t establish a connection to the server at wss://localhost:8080/app/7fanwflljf8wz6dd4ft5protocol=7&client=js&version=8.4.0&flash=false
I haven't changed any configuration settings recently, so I'm not sure why this error suddenly appeared.
Here are some details about my setup:
Environment:
Laravel with Laravel Echo for event broadcasting.
I am using a WebSocket server (likely laravel-echo-server or a similar package) that is expected to run on localhost port 8080.
My client is trying to connect using a secure WebSocket
wss://
protocol.
What I've checked/tried so far:
- Verified that my WebSocket server is running on port 8080.
- Confirmed that my client configuration in JavaScript is set up to connect to the correct host/port.
- Made sure that I haven’t accidentally switched between
ws://
andwss://
without updating my server settings. - Ensured that no recent changes were made in the configuration regarding ports or protocols.
My questions are:
- What could be causing Firefox to be unable to establish a secure WebSocket connection to
wss://localhost:8080
? - Are there any common pitfalls when using Laravel Echo with a self-hosted WebSocket server on localhost that I might be overlooking?
- How can I further diagnose this issue (for example, checking SSL certificates for localhost or debugging connection issues)?