feat(egress): coxswain egress tunnel + relay-routed gRPC/SSH dialers#32
Merged
Conversation
Decision 19: coxswain reaches nodes through a relay so a node never sees coxswain's IP. internal/egress.Tunnel TLS-dials the relay, holds a yamux client session (lazy reconnect on a dead session), and exposes DialContext — the single chokepoint both control channels route through: - gRPC NodeControl: control.NewDialer gains WithContextDialer. - SSH: ssh.DialConfig gains an optional Dialer. Both opt-in and backward-compatible — direct dial stays the default. The mTLS and SSH handshakes run end-to-end over the relayed conn, so the relay is protocol-blind. Full coxswain->relay->node path (and lazy reconnect) proven in internal/egress tests against beacon's egress relay. Dev: go.mod replaces github.com/PharosVPN/beacon => ../beacon for the new egress package; drop once beacon's egress branch lands and the dep is bumped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 1, 2026
beacon's egress package is on main now (PharosVPN/relay#6, #7), so bump the beacon dependency to it and remove the development `replace => ../beacon`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Coxswain side of control-plane egress relaying (decision 19). Reaches nodes through a relay so a node never sees coxswain's IP.
internal/egress.Tunnel— TLS-dials the relay, holds a yamux client session (lazy reconnect), exposesDialContext: the one chokepoint both control channels route through.control.NewDialergainsWithContextDialer.ssh.DialConfiggains an optionalDialer.Both opt-in and backward-compatible — direct dial stays the default; the mTLS / SSH handshake runs end-to-end over the relayed conn (relay stays protocol-blind). Full coxswain→relay→node path + lazy reconnect proven in
internal/egresstests against beacon's egress relay.Merge order / dev replace: go.mod has
replace github.com/PharosVPN/beacon => ../beaconfor the new egress package. Land PharosVPN/relay#6 first, bump the beacon dep here, then drop the replace.Not yet wired into the CLI (deferred): enabling relaying will make the egress relay a DB-enrolled relay (reusing beacon enrollment) and thread the Tunnel through the dialer call sites, then live-validate. Depends on PharosVPN/docs#12 (decision 19).
🤖 Generated with Claude Code