Trouble with Hass.io and WebSocket on local network

I have just started setting up external access for my HASS.IO powered C.H.I.P computer and added the SSL certificates I already had. Everything seems to work well, when I am at home, I can access Home Assistant via https://<ip-address>:8123 and from away I can access it via https://<my_url.com>:8123. So far, so good.

But what does not work is accessing https://<my_url.com>:8123 when I am in the same network as the HASS.IO computer. I initially get the password screen, but when entering the right password, the connecting screen and spinner won’t disappear.

Checking the JS console I see the following error:

(unknown) WebSocket connection to 'wss://<my_url.com>:8321/api/websocket?latest' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT

When accessing it either via URL outside the network or via IP within the network, the WebSocket requests work just fine.

When accessing https://<ip-address>:8123/api/websocket?latest I get:

No WebSocket UPGRADE hdr: None
 Can "Upgrade" only to "WebSocket".

Same from away via URL, while locally via URL the connection times out.

I tried this on various browsers and machines and also cleared all cookies, always the same error.

Accessing my website (hosted under the same URL on another server and port) works remotely as well as from the local network.

Not sure if this is the right forum to post in (i.e. if it’s Hass.io related or some other issue).

My setup:

  • ZTE F680 router connecting to the internet (fiber, Pepephone in Spain) with port forwarding set up to
  • Google WiFi router (wired connection) with static IP to ZTE, has its own subnet for devices and port forwarding to
  • C.H.I.P running HASS.IO with Home Assistant version 0.62.1

I would appreciate any help as I’m quite stuck here… :slight_smile: Thanks!

1 Like

Hi, since the latest update I’ve been having the same problems. Did you find a solution?

Hey @cindyvandorst, no sadly I still keep getting the same error. What’s your setup? Maybe we can try to narrow the error source down a bit…

Hi @nicolas-fricke, I was able to solve it by deleting the db (home-assistant_v2.db) and take the power off. After that I tried reaching the webinterface and monitored the progress (via F12) of the webpage loading. I waited several minutes and then it succeeded ;-).

hi @nicolas-fricke, I have more or less the same setup, (even the same router), and the same problem. Have you managed to solve that? deleting the db looks risky…

Hi @cindyvandorst this is the correct solution? You don’t have troubles?

I answer myself, I deleted the DB and still having the same problem :frowning:

Sorry for not getting back earlier – I also tried deleting the DB, but sadly also without any luck. For now, I simply use the local IP when at home and the URL when accessing my HA remotely.

If anyone finds a solution, I’d be very keen to know :slight_smile:

I’m having this issue too, but just wanted to say that an easy workaround I found is to use a VPN when connecting locally. Then I can still connect using my domain.

I have a very similar configuration and the exact same issue. I still haven’t figure it out.

Having the same issue here. Deleting the DB didn’t solve it either :-/

Did anyone here who had this issue eventually find a fix?

I’m using Hass.io
Home Assistant 0.102.3
Frontend version: 20191119.6

I am using Nethserver as my firewall / router. Was able to reverse proxy a https call to my homeassistant system and it works through a web browser however, with the android application it will not work. The application works with a reverse proxy only if using HTTP. HTTPS and HTTP work fine through a browser but HTTPS just wont work with a reverse proxy with the android app.

Is there a fix for this?

Hi, see this thread from mpietersen. Maybe api/websocket headers

and this thread from Fredrike or el-Salmon