Repository navigation
Require pairing for WebRTC browser viewers - #794
Open
jmccaffrey-nv wants to merge 3 commits into
Open
jmccaffrey-nv wants to merge 3 commits into
jmccaffrey-nv wants to merge 3 commits into
Conversation
A V2 WebRTC server accepted a new or replacement viewer from any client that could reach its port. Viewer admission and file uploads now require an owner credential, a strict Host/Origin policy and an HTTPS origin outside loopback. Authorization runs before offer parsing and upload reads, and generation checks fence requests that were in flight when the viewer changed. By default the serving rank creates a private credential once (~/.config/flashdreams/webrtc-token) and reuses it. On an interactive terminal the runner prints a one-click link that carries the code in the URL fragment, which is never sent to the server; logs get only the URL and the credential path. --no-login keeps tokenless loopback for a trusted single-user machine and is refused anywhere else. The credential is also read on Windows, where profile ACLs protect it. Replacing a viewer releases its held keyboard, mouse, gamepad, wheel and native UI input through a focus-loss boundary that leaves model history and reset generations unchanged. Retired callbacks, frames, uploads and deferred input are dropped. Walkthroughs and the HandDreams launcher open the viewer on loopback with an SSH forward instead of --host 0.0.0.0. Signed-off-by: Jonathan McCaffrey <jmccaffrey@nvidia.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
/ok to test 41d2ad4 |
Contributor
[Critical impact] The PR appears safe to merge; no new actionable issues remain. SummaryThe PR requires browser pairing for standard WebRTC launches and clears retired viewers' input without resetting model history.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Browser request] --> B{Host and Origin allowed?}
B -->|No| C[Reject request]
B -->|Yes| D{Owner credential accepted?}
D -->|No| C
D -->|Yes| E[Negotiate viewer]
E --> F{Credential still current?}
F -->|No| C
F -->|Yes| G[Retire old viewer and clear its input]
G --> H[Install new viewer]
Reviews (3) · Last reviewed commit: "Launch the HandDreams CLI test on loopba..." · Reviewed by Greptile |
HandDreams created the WebRTC viewer without running the WebRTC mode's argument checks, so --no-login with FLASHDREAMS_WEBRTC_TOKEN_FILE set loaded the credential instead of refusing the conflicting options. Creating the WebRTC window now runs those checks, and the Isaac Teleop and remote Quest modes apply them before anything is built. The HandDreams launcher also printed the LAN address for the viewer, which now listens on loopback. It prints the loopback URL and the SSH forward to reach it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jonathan McCaffrey <jmccaffrey@nvidia.com>
Collaborator
Author
|
/ok to test 3bbae74 |
jmccaffrey-nv
enabled auto-merge
November 26, 2026 06:24
jmccaffrey-nv
disabled auto-merge
November 26, 2026 08:23
The HandDreams CLI test passed --host 0.0.0.0, which the WebRTC mode now refuses without an approved origin, so both of its cases exited with status 2 in CPU CI. The test only checks how the launcher parses its arguments, so it now uses 127.0.0.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jonathan McCaffrey <jmccaffrey@nvidia.com>
This branch has not been deployed
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
A V2 WebRTC server admitted a new or replacement viewer from any client that could reach its port. This PR requires the viewer to be paired with the server's owner credential, and it is still one click on a local launch.
~/.config/flashdreams/webrtc-token(mode 0600, in a 0700 folder) and reuses it across restarts. On an interactive terminal the runner prints a one-click link,http://127.0.0.1:PORT/#pair=…. The code travels in the URL fragment, which the browser never sends to the server, and the page removes it from the address bar. Logs and batch output show only the URL and the path to paste the code from.FLASHDREAMS_WEBRTC_TOKEN_FILEselects a managed credential.FLASHDREAMS_WEBRTC_ALLOWED_ORIGINSallows a TLS front end.--no-loginkeeps tokenless loopback for a trusted single-user machine. It is refused off loopback, with configured origins, or with a token file, in every mode that serves a viewer, including HandDreams.O_NOFOLLOW,O_NONBLOCKandgeteuidonly where they exist. Owner and mode are checked on POSIX; on Windows the user profile's ACLs protect the file.--no-loginand credential rotation. Walkthroughs, the HandDreams launcher and the multi-node Slurm probe now open the viewer on loopback with an SSH forward instead of--host 0.0.0.0.Validation
All checks ran on CPU.
pytest -m ci_cpu:flashdreams/test_v2: 459 passed.test_mode_is_registered_as_a_v2_client_window_plugin, needs the controller-input package installed so its entry point is registered. It fails the same way onmainin this environment.ty checkreports no new diagnostics.ruff,ruff format).zensical buildpasses.Not exercised: GPU rendering, a real browser or TLS proxy, a real Windows host, and the full repository
ci_cpurun (CI covers it).🤖 Generated with Claude Code