Edge -> Backend Websocket API - Paths and Specification

Hello,

I have tried to find another post on this topic, and I am sure it has been asked before so please point me in the right direction if it exists!

I am writing some code to accept incoming OpenEMS Websocket connections to a different backend application. I am trying to find out what the path / URI is for the websocket connection.

For example, let’s say I am running my edge and backend on localhost and have my websocket server open on 8081.

What is the path that the edge will connect to? If I set the backend URI as ws://localhost:8081/ on the edge - is there any other additional path that identifies where the edge is connecting and sending requests to? (i.e something like “/ws/…”)

Thanks,
Thomas

If I get your question right, you might check how it is built at: openems/ui/src/themes/openems/environments at develop · OpenEMS/openems · GitHub
edge-dev.ts defines as:

url: "ws://" + location.hostname + ":8085"

So to answer your question: By default there is no path (like /ws/) but you might change it in your code.

I assume you like to use another proxy like nginx to shield direct connections?

Thank you!

So the WS requests are just being sent to the default path - i.e ws:// hostname + port?

Yes, in production we would use additional security measures but I am just interested in the path for the edge → backend websocket for now.