WebSocket Connection Issue: Edge Disconnects Immediately After Connecting to Backend (Docker Setup)

Hello,

I’m working on running OpenEMS using Docker. While the WebSocket connection is successfully established between the edge and the backend(with authentication via an apiKey), the connection is immediately closed. Interestingly, when I manually test the WebSocket connection using tools like wscat or curl from inside and outside the container, the connection remains open and functional. From the logs, the Edge app successfully completes the handshake, but as soon as it attempts to interact with the WebSocket (e.g., sending a message), the backend closes the connection, citing a “Connection refused” error.

Thank you in advance for your help!

1 Like

Edit: When i run openems without docker it works perfectly, i think there is something wrong with the containerization (it’s not a docker network related issue because i can open a websocket using wscat from inside the container).

Any help is appreciated.