Repository navigation
Prepare unified native remote establishment and trusted stream admission - #384
Merged
Merged
Conversation
Tryanks
marked this pull request as ready for review
September 8, 2026 17:48
This was referenced Sep 8, 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.
What changes
Prepares the existing unified remote entry for a later transport adapter; this does not implement iroh. Relates to #376.
Existing native HTTP/HTTPS pairing, the main WebSocket and paired Preview now share origin validation, DNS, staggered address attempts and TCP/TLS establishment. WebSocket address attempts still race through the full upgrade and hello, preserving terminal authentication failures and the existing handshake deadline. NativeClientHost pairing uses cancellable async I/O while synchronous CLI callers keep their existing interface. HTTPS /pair already used the same code-to-token flow; this adds no certificate-based pairing or new authentication mechanism.
RemoteServer admits generic duplex streams into the existing HTTP, WebSocket, NDJSON and CONNECT dispatch. Imported streams always have remote provenance and cannot gain local administration from loopback forwarding or X-Forwarded-For. Actual direct peers retain existing authorization and first-time password/pairing behavior. Both entries share connection limits and shutdown. Async split I/O preserves read/write concurrency and write-half close; native accept uses async-net's TCP close contract.
macOS keeps its existing Preview URL mapping and slot lifetime, now including HTTPS paired origins. Windows/Android use an attachment-owned raw loopback bridge to the same host entry, retaining native proxy authentication and bypass behavior. Windows' callback and Android's proxy configuration receive the bridge origin and existing token. Remote WebView2 environments use temporary directories owned with the environment because attachment proxy arguments differ; local Preview retains its existing directory.
Why these seams
TCP versus TLS and direct versus imported streams are current variability. Establishment policy disappears from individual callers; protocol, auth, replay/recovery, URL mapping and host dispatch remain at their existing owners. The native bridge does not parse or recreate HTTP and adds no business protocol, global route table, persisted identity format, account, registry or iroh dependency.
Regression evidence
Targeted production-entry tests passed during implementation, including existing HTTPS pairing compatibility, WS/Preview CONNECT over verified TLS, imported local-admin denial with a spoofed header, existing direct-local admin, token rejection, HTTP timeout/cancellation, native bridge authentication and reverse half-close, admission cancellation/shutdown, existing Preview mapping/lifetime, reconnect and replay tests.
All required local checks passed (exit 0) on
6b33382054f3629a7ad004ce6ef8c95549c27f87:cargo fmt --all --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo build --workspace --lockedcargo test --workspace --locked, including existing runtimeremote_livenessstalled-address, rejected-token and stopped-host tests; existing ignored environment-dependent fixtures remain ignored.RUSTFLAGS='-D warnings' IPHONEOS_DEPLOYMENT_TARGET=26.0 cargo check -p tcode-ios --target aarch64-apple-ios-sim --lockedRUSTFLAGS='-D warnings' ANDROID_HOME=/opt/homebrew/share/android-commandlinetools ANDROID_NDK_HOME=/opt/homebrew/share/android-commandlinetools/ndk/27.1.12297006 cargo ndk -t arm64-v8a check -p tcode-android --lockedRUSTFLAGS='-D warnings' cargo check -p tcode-web --target wasm32-unknown-unknown --lockedcargo-machete .using direct binary version 0.9.2 (avoids the known wrapper invocation bug).Local Cargo checks used
CARGO_TARGET_DIR=/Users/tryanks/RustroverProjects/tcode/targetandCARGO_PROFILE_DEV_DEBUG=line-tables-only. Build emitted the macOS linker large-unwind-table warning; Cargo also reports the existingblock0.1.6 future-compatibility notice. Neither is a Clippy/source warning failure.Hosted CI run 34258034479 passed on that same head: plan, dependency hygiene (8s), mobile/Web (2m32s), Linux (7m55s), macOS (10m2s), and Windows (10m33s). The existing-run watcher exited 0. All required checks passed. The lead inspected the final source and head-bound local evidence before merging.
Remaining integration and validation scope
No iroh endpoint ownership, dialing/admission adapter, route/identity/discovery integration, relay deployment or browser transport integration is included. WebHost still uses browser fetch and WebSocket at the page origin. Iroh WASM support does not automatically adapt those interfaces or arbitrary Preview page networking. iOS still lacks embedded Preview.
Native Windows/Android UI acceptance was not run; local platform compilation passed as listed above. No provider prompt, user profile or original checkout was used for acceptance. Merged after lead source/evidence review and all required checks passed.