When I'm using otmonitor in the home assistant addon, otmonitor is embedded in the home-assistant application. As a result all requests are proxied through nginx from an endpoint location that contains random upper and lower chars and an underscore.
The url endpoint location when proxied is for example: $hostname/api/hassio_ingress/ERFaegsGr54tw5y4sgerga/status.html but the websocket connections are tried to $hostname/status.ws.
The regex for matching the websocket url from the page uri does not include those chars and matches only lowercase until the first /, which is why the ws connections errors out with a 404.
WebSocket connection to 'wss://$hostname/status.ws?var=gui&var=error' failed: Error during WebSocket handshake: Unexpected response code: 404
By "widening" the regex matching A-Z_/ too, I'm trying to use up until the last / of the url instead of the first one, which allows connecting to the websocket even when proxied through an endpoint.
Hello sir,
When I'm using otmonitor in the home assistant addon, otmonitor is embedded in the home-assistant application. As a result all requests are proxied through nginx from an endpoint location that contains random upper and lower chars and an underscore.
The url endpoint location when proxied is for example:
$hostname/api/hassio_ingress/ERFaegsGr54tw5y4sgerga/status.html
but the websocket connections are tried to$hostname/status.ws
.The regex for matching the websocket url from the page uri does not include those chars and matches only lowercase until the first
/
, which is why the ws connections errors out with a 404.WebSocket connection to 'wss://$hostname/status.ws?var=gui&var=error' failed: Error during WebSocket handshake: Unexpected response code: 404
By "widening" the regex matching
A-Z_/
too, I'm trying to use up until the last/
of the url instead of the first one, which allows connecting to the websocket even when proxied through an endpoint.