libvncserver: add WebSockets handshake mode#717
Open
marcofortina wants to merge 3 commits into
Open
Conversation
Member
|
@marcofortina please lower the volume of incoming PRs, my AI can't keep up. |
Contributor
Author
your AI ? |
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
Improve WebSockets/RFB handshake handling so slow normal RFB clients are no
longer forced through a fragile timing-only auto-detection path, while still
giving embedders an explicit way to select the expected transport.
Issue #438 reports that WebSockets auto-detection is fragile for slow normal
RFB clients. The server used a short fixed wait for a client-first WebSockets
header before falling back to normal RFB, which made mixed WebSockets/RFB
listeners sensitive to timing.
Changes
rfbWebSocketsHandshakeModetorfbScreenInfo:rfbWebSocketsHandshakeAuto: default auto-detection behaviour.rfbWebSocketsHandshakeRfb: skip WebSockets probing and proceed as normal RFB immediately.rfbWebSocketsHandshakeWebSockets: expect a WebSockets client and wait up to the configured client wait timeout.-websocketmode auto|rfb|ws.autofor compatibility with existing deployments.-websocketmode auto|rfb|wsin the WebSockets README section.autopath tolerate slow normal RFB clients instead of treating the short WebSockets probe as the only decision point.rfbmode bypassing WebSockets socket peeking;automode;Validation
cmake -S . -B build-438-patch \ -DWITH_EXAMPLES=OFF \ -DWITH_TESTS=ON \ -DWITH_OPENSSL=OFF \ -DWITH_GNUTLS=OFF \ -DWITH_GCRYPT=OFF \ -DWITH_SDL=OFF \ -DWITH_GTK=OFF \ -DWITH_QT=OFF \ -DWITH_FFMPEG=OFF \ -DWITH_XCB=OFF \ -DWITH_LIBSSHTUNNEL=OFF \ -DWITH_SYSTEMD=OFF \ -DCMAKE_BUILD_TYPE=Debug cmake --build build-438-patch --parallel 1 ctest --test-dir build-438-patch --output-on-failureResult:
Notes
This keeps the existing default
automode, but makes it robust for the slownormal-RFB-client case reported in #438. Deployments that know the expected
transport can also opt into
-websocketmode rfbor-websocketmode ws.The PR does not add any non-standard RFB wire messages, encodings, security
types, or pseudo-encodings. It only changes how the listener decides whether the
connection should enter the WebSockets handshake path or the normal RFB path.
Closes #438.