Home Assistant Websocket Not connecting
-
I have a Home Assistant setup and I just switched out my home router with pfSense. I have setup Port forward 80 and 443 and the page comes up with the logo and seems to get to the loading screen.
It looks like it is loading then fails, seems like the websockets are failing to get established.
If I connect over the local lan everything works fine, so I don't think it has anything to do with the Home Assistant setup.
Is there anything special blocking websockets on pfSense, I have done a basic setup and nothing fancy other than the port forwarding.
Any help would be appreciative.
-
I’d set up a VPN rather than port forwarding.
-
Yeah I wouldn't be opening up that to the public internet.. Have you locked down these port forward rules to your source IP?
Such access from outside your home should be done via vpn..
Where is your port 8123, this is the default port.. Did you bother to even breeze over their documentation?
https://www.home-assistant.io/docs/configuration/remote/ -
Yes it is locked down, its running through nginx with a stong password and fail2ban. Did you even read my post? suggesting vpn is not a solution at this moment since some components need remote access.
The problem is the websocket is not getting through. I need help with that.
-
The first mention of VPN is in my post. yes I did read your first post.
Do a packet capture on the LAN side, that might help solve your issue.
-
@NogBadTheBad Ya wasn't really directed at you. Thanks for the suggestion but won't work for me right now.
Sorry if I offended you just got a snarky comment when I am trying to solve the problem of this websocket issue. My old router worked just fine, so I am baffled why I am having issues. -
@scottix said in Home Assistant Websocket Not connecting:
Yes it is locked down, its running through nginx with a stong password and fail2ban
That is not what I asked - nor is that locked down ;)
Do you have a clue to what a vpn even is? What does your access to your network via running remote access on your pfsense have to do with components needing remote access.
Here is my suggestion - hit the books how this stuff works before opening anything up from the internet into your network..
-
@johnpoz
Ok this is getting toxic, I guess I am not getting help here. Have a good day.For the record I do know this stuff.
-
Ok I found the issue.
Between setting up and trying to get things to work. A reboot of the modem caused the ip address to change.
Since pfSense cached the dns query it was still redirecting the https queries locally and not showing any https issues. When the websocket was trying to make a direct connection it was going to the old ip address which obviously would fail.
It is interesting the https didn't fail out but the wss connection did, which led to the confusion, anyway thanks for the suggestions.
I will think about limiting the connections to the web server, not sure how I will let certain external service still ping it to notify me of things, not everyone lists their ip addresses they use. Anyway peace.
-
@Scottix I seem to have this same issue. However my IP's do not change for the system with websockets. I get the same issue on multiple apps that use websockets.
My DHCP is giving out the DNS servers for the two local DNS servers which both have the correct IP for the server inside the network. What I think is occurring is sometimes the clients are going to the outside network and sometimes the internal network.
Possibly when it goes out then comes back to itself I do not have a firewall rule to allow WSS maybe. However I do not understand why the dns might look outside to comeback in. I have also disabled DHCP6 but that did not resolve the issue either. Any other suggestions?