Repository navigation
feat(p2p): support offline LAN forwarder discovery, admission, and manual host entry - #263
Merged
Merged
Conversation
…n endpoint change
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
Enables the receiver to discover and connect to forwarders directly over a local network (Ethernet or Wi-Fi) without internet or server connectivity, while working seamlessly alongside an existing server configuration:
services/forwarder,crates/rt-iroh):Connection::paths()viart_iroh::is_lan_connectionso incoming direct private/link-local IP connections are automatically admitted whenp2p.allow_lan_receiversis enabled (defaulttrue), even whenserver_urlis configured and even if the receiver'sEndpointIdis not on the server allow-list.AllowList::apply_updaterevocations while continuing to enforce the server/cached allow-list for relay and public-IP connections.allowlist_cache_pathto ap2p-allowlist.cachesibling ofsecret_key_pathand moves first-boot device-token minting into the background server task so an offline server does not block P2P startup.crates/rt-iroh,services/forwarder,services/receiver):spawn_forwarder_lan_beaconon UDP 7448 andspawn_receiver_lan_listeneron UDP 7449) advertisingendpoint_id, bound P2P port, local interface IPs, anddisplay_name.display_name,p2p_endpoint_id,p2p_listen_port, andp2p_direct_addrson/api/v1/statusand addsoptional string display_name = 3toStreamCataloginproto/p2p.proto.add_forwarder_by_hostto probehttp://<host>/api/v1/statusby IP or.localhostname, persist discovered peers in the receiver'sknown_forwardersSQLite table, and periodically refresh manual host addresses.crates/rt-iroh,services/receiver,apps/receiver-ui):endpoint_id-keyeddiscovered_forwardersmap without duplicate entries, ordering LAN addresses ahead of WAN addresses.iroh::address_lookup::memory::MemoryLookuponrt_iroh::Endpointand pushes newly discovereddirect_addrsinto activeForwarderConnectionworkers so iroh's multipath selector prefers direct LAN paths and falls back to relay/internet paths automatically..localhost form inConnectionsTab.svelteand updatesgetOverallHealth()to report healthy when local forwarders are connected without a server configured.Verification
cargo test --workspace --libcargo test -p receiver -p receiver-tauri -p forwarder -p rt-iroh -p rt-p2p-protocol -p rt-test-utils -- --test-threads=4cd apps/receiver-ui && npm test && npm run check && npm run lintuv run scripts/e2e/run_stack.py(69/69 checks passed)Written and posted by AI on behalf of Isaac.