Skip to content

c0mpute edge: share :443 behind an SNI router (PROXY protocol + fallback) - #32

Merged
ralyodio merged 2 commits into
mainfrom
c0mpute-edge-behind-sni-router
Nov 9, 2026
Merged

ralyodio merged 2 commits into
mainfrom
c0mpute-edge-behind-sni-router

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

No fleet box has a free IPv4 :443, so the edge has to run behind dev2's nginx stream SNI router. The router cannot know which Moshpit names are c0mpute sites (holders change that at any time), so it sends the edge every Moshpit-shaped name it has no route for, and the edge sorts them.

  • lib/sni-front.ts: a plain TCP front that reads an optional PROXY v1/v2 header and the ClientHello SNI without terminating TLS. c0mpute names (per the registry) go to the edge's TLS server with the header stripped; everything else is spliced byte for byte, header included, to EDGE_FALLBACK.
  • EDGE_PROXY_PROTOCOL, EDGE_FALLBACK, EDGE_HOST documented in the README c0mpute edge section.
  • Tests: header and SNI parsing against a real Node ClientHello, and an end-to-end edge with a PROXY header serving a c0mpute name and splicing another name to a fallback unchanged. Full suite 111/111 locally.

Without either variable the edge behaves exactly as before.

🤖 Generated with Claude Code

…ack)

EDGE_PROXY_PROTOCOL reads a PROXY v1/v2 header off each https connection and
EDGE_FALLBACK splices every TLS connection that is not a c0mpute name to the
origin that owned it, header included. Lets the edge run on a box whose :443
already belongs to an nginx stream SNI router.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit dd5a98e into main Nov 9, 2026
1 check passed
@ralyodio
ralyodio deleted the c0mpute-edge-behind-sni-router branch November 9, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant