SSE Secure Connection

Hello everyone,
I’m currently developing a small application for openhab3 in JavaScript.
This already receives the changes of various items via the SSE connection.

http://serverAdress:8080/rest/events?topics=openhab/items/Item_xy/statechanged

For this I use the EventSource Classe to receive the data.
Unfortunately, the EventSource class does not support direct authentication with username/password or token. The Openhab web interface does that somehow too. (Cookies ???)
My question now would be how I can receive the events via a secure connection (username/password, token, etc.).

  • Platform information:
    • Hardware: Docker
    • OS: Docker Caspian
    • Java Runtime Environment: Docker Image
    • openHAB version: openHAB 3.3.0.RC1

Thank you in advance :slight_smile:

Hello again from me,

I was able to solve my problem in the meantime. The default EventSource class does not support direct parameters. I found GitHub - Azure/fetch-event-source: A better API for making Event Source requests, with all the features of fetch() for this.
With this class it is possible to specify the header directly.
Nice side effect, this class also establishes the connection itself.
Many greetings

partytown