Repository navigation
Carry a paired phone's HTTP over its encrypted socket on the local network - #6767
Merged
Merged
Conversation
…n the local network A device socket that finished the encrypted handshake can now send http-req frames, which are replayed to the local API the same way relay frames are. The bearer in the frame must belong to the socket's own device. e2ee-ready advertises the capability as data.http = 1 so a phone build can choose it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hurttlocker
enabled auto-merge
November 24, 2026 20:52
🔍 PR Review Bot
Automated review — CI workflow |
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.
What changes
A paired phone on the local network can send its HTTP requests over its existing end-to-end encrypted WebSocket instead of plain HTTP.
http-reqframes. They are replayed to the local API exactly like relay frames: the request is stamped as remote, never as loopback, so the device bearer is gated by the same device route list.device_mismatch.encrypted_device_socket_requiredand nothing reaches the API.e2ee-readynow carriesdata: { http: 1 }, so a phone build can tell this desktop supports it and fall back to direct HTTP on an older desktop.Nothing changes for current phone builds. A follow-up phone change uses this path; after a phone build with it is released, a later change can refuse device bearers on plain non-loopback HTTP.
Tests
tests/mobile-lan-encrypted-http-real-path.test.tsstarts the real WebSocket server on a non-loopback address with a seeded device, completes the encrypted handshake, and checks:e2ee-readyadvertiseshttp: 1;http-reqreaches the local API as a remote request with the device's own bearer and comes back as an encryptedhttp-res;Against main's server it fails on the missing advertisement.
src/lib/mobile/lan-encrypted-http.test.ts: operator sockets, a socket mid-handshake and an unencrypted device socket are refused without a fetch.npm run typecheck:fast,npm run verify:ci.🤖 Generated with Claude Code