Autoreload WebSocket error: connection refused

Hi there.

I’m using Local and everything is working fine. Except for autoreload.
I have a project which uses Brunch (brunch.io) as a build tool. It includes a watch feature to live-compile files and it also do the autoreload thing. But the autoreload is not working.

In the console I got this error:
WebSocket connection to ‘ws://mywebsite.dev:9485/’ failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

I don’t know maybe someone out there has the same problem, or maybe this issue is more generic and related to WebSocket, despite my Brunch configuration.

Thanks!

Bump, i need this too

My guess is that the Brunch host setting needs to be localhost or 127.0.0.1 and not the site domain.

Trying to access the site domain at that port will send a request the Local VM with that port instead of Brunch.

Hey clay, thanks for your answer, already tried what you suggested but is not working, i suspect is a port issue

Did you try setting the client side settings with this? https://github.com/brunch/auto-reload-brunch#client-side-settings

Make sure the host there is also 127.0.0.1 if it isn’t already.

1 Like

Thanks clay, setting the host to 127.0.0.1 with the Brunch client-side settings worked.

1 Like