Closed mStirner closed 6 months ago
[!TIP] Workaround: Create 2 interfaces with the same host/port settings. Use one dedicated for HTTP and one for WebSocket connections.
Use new interface method .bridge()
to create new sockets.
In v4 the iface.httpAgent()
,iface.httpsAgent()
uses this under the hood and no action/workaround is needed anymore.
See https://github.com/mStirner/backend/commit/fe8c2a94b920d7a09d62e65aa956ad13e1c9b4b2
Alle Jahre wieder...
When a interface connection is used for http and alter for https, its break the websocket connection. "RSV ... frame must be clear". This is due to the "keep-alive" handling in the
iface.httpAgent()
:https://github.com/OpenHausIO/backend/blob/d17066bd3bd43878371d2fa618651068c95ed78c/components/devices/class.interface.js#L285-L287
The agent is created, cached, and then the agent from the http request is returned: https://github.com/OpenHausIO/backend/blob/d17066bd3bd43878371d2fa618651068c95ed78c/components/devices/class.interface.js#L210-L212
There needs to be a way to check the URL for which the connection is used.
Cause the trouble described above. Add a option to the agent to unpipe everything from the upstream & re-create a new uncached agent?