[openhabcloud] Handle WebSocket connections to server#20238
Open
digitaldan wants to merge 3 commits intoopenhab:mainfrom
Open
[openhabcloud] Handle WebSocket connections to server#20238digitaldan wants to merge 3 commits intoopenhab:mainfrom
digitaldan wants to merge 3 commits intoopenhab:mainfrom
Conversation
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds WebSocket connection proxying support to the openHAB Cloud connector, enabling WebSocket protocol communication between the Cloud Connector and openHAB server. The implementation introduces a custom ProtocolHandler to intercept upgraded WebSocket responses, access the underlying EndPoint, and upgrade its Connection to a custom implementation that proxies plain socket data.
Changes:
- Added WebSocket proxy upgrade handler to intercept and handle HTTP upgrade responses with status 101
- Implemented OpenHABWebSocketConnection class to proxy WebSocket data between cloud connector and openHAB server
- Added WebSocket data event handling to read/write data through the upgraded connection
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
....openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClient.java
Outdated
Show resolved
Hide resolved
....openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClient.java
Outdated
Show resolved
Hide resolved
....openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClient.java
Outdated
Show resolved
Hide resolved
....openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClient.java
Show resolved
Hide resolved
....openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClient.java
Show resolved
Hide resolved
Contributor
Author
|
I'll review the pr feedback today just FYI. |
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
Contributor
Author
|
I think this one is good 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a rebase and then some changes to #16403. I have already deployed the websocket changes to our myopenhab service, although its turned off in the load balancer at the moment until we can get this ready/merged.
I would also recommend to backport to a patch release, it won't break any existing functionality, but the sooner we can can user's upgraded and this in the wild, the better.