Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jerome Louvel <374450+jlouvel@users.noreply.github.com>
Keep only a generic NettyConnectionUpgrade hook in the core connector. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jerome Louvel <374450+jlouvel@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jerome Louvel <374450+jlouvel@users.noreply.github.com>
org.restlet.ext.websocket.internal is not exported by the module. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jerome Louvel <374450+jlouvel@users.noreply.github.com>
Negotiate permessage-deflate (RFC 7692) on the server and the client, cap inflated messages by the message size, and add a separate frame size limit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jerome Louvel <374450+jlouvel@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
thboileau-git
approved these changes
Oct 19, 2026
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.



Summary
Adds experimental WebSocket support as a new
org.restlet.ext.websocketextension module, on top of the Netty connectors (stacked on #1546). It keeps the blocking, virtual-thread programming model. The core only gains a small, generic connection-upgrade hook.Core (
org.restlet,org.restlet.engine.netty)NettyConnectionUpgrade: if a Restlet returns101 Switching Protocolswith this response attribute, the Netty server connector removes its HTTP handlers and hands the HTTP/1.1 connection to the upgrade instead of writing the response. HTTP/2 and HTTP/3 calls get 501. If the upgrade fails, the connection is closed.NettyUpgradeContext: the channel, the upgrade request head, TLS flag, connector parameters and attributes, idle timeout and logger.Extension (
org.restlet.ext.websocket)WebSocketUpgrader: aRestletthat accepts or rejects upgrades and can pick a subprotocol. The upgrade goes through normal routing, filters and authenticators.WebSocketUpgrade: lower-level hook (isRequested,getRequestedSubprotocols,accept(response, handler, subprotocol)).WebSocketHandler: runs on its own virtual thread per session. Returning closes with 1000; throwing closes with 1011.WebSocketSession: blockingreceive()(null once closed),sendText/sendBinary/send,close(code, reason),getSubprotocol, close status and reason.WebSocketMessage: immutable text or binary message.WebSocketClient: builder-configured client forws/wss(SSL context, subprotocols, extra handshake headers, timeouts, max message and frame sizes, compression, hostname verification).permessage-deflate(RFC 7692) on server and client, on by default; inflated messages are capped by the message size (1009 otherwise).websocket.maxSessions(extra upgrades get 503),websocket.maxMessageSize(default 65536),websocket.maxFrameSize(defaults to, and capped by, the message size) andwebsocket.compression(defaulttrue).Scope / limits
Validation
./mvnw -B -pl org.restlet,org.restlet.ext.websocket verify -P default,testpasses for both modules, including Spotless, JaCoCo 80% and SpotBugs (0 findings in the extension).NettyConnectionUpgradeTestCasecovers the connection hand-over and a failing upgrade.wssover TLSjava.net.http.WebSocketclientpermessage-deflatenegotiation (accepted, disabled, not offered), compressed round trips, inflated messages capped at the message size, frame size limits on server and client