DocsOpen app

The SSH bridge and HTTP/3 downloads (EDGE-4)

Workers take no raw TCP on port 22, so the cloud serves SSH through a bridge (F14, DEP-3): Cloudflare Spectrum accepts TCP 22 at the edge and forwards it to…

Workers take no raw TCP on port 22, so the cloud serves SSH through a bridge (F14, DEP-3): Cloudflare Spectrum accepts TCP 22 at the edge and forwards it to the self-host binary zuppo, which speaks russh git over SSH on the cloud's state. When Worker connect() is GA the bridge goes away; the SSH keys, grants and policy checks do not change.

text
git ─ssh─▶ Cloudflare Spectrum (tcp/22, PROXY protocol v2) ─▶ zuppo serve --ssh-proxy-protocol <Cloudflare ranges>

SSH is authorised exactly as on a plain self-host: a key registered with zuppo admin ssh-key-add is bound to a grant, and each git command runs with a git token refreshed from that grant, so the grant service and Cedar policy (POL-5) decide every fetch and push. The bridge adds only the client address.

Run the bridge

sh
zuppo serve … --ssh-listen 0.0.0.0:22 \
  --ssh-proxy-protocol "$(curl -s https://www.cloudflare.com/ips-v4 | paste -sd, -)"

--ssh-proxy-protocol CIDRS (ZUPPO_SSH_PROXY_PROTOCOL) is a comma-separated list of IP addresses and CIDR blocks: the proxies. With it set, every SSH connection must

  • come from one of them (anything else is closed at once, ssh connection refused: not a trusted proxy), and
  • open with a PROXY protocol v1 or v2 header within 5 s (otherwise it is closed).

The header's source address is the client's, and is the peer in the SSH log lines. A header that names no client (a v2 LOCAL health check, v1 UNKNOWN) keeps the proxy's own address. Without the flag SSH is served on plain connections, as before. Firewall the bridge's port to the proxy as well: the trust list is the second guard, and a header from an untrusted peer is never read.

Use the v2 setting on the Spectrum application (proxy_protocol: "v2"); the decoder takes v1 too. The header is decoded by the sans-IO crate zuppo-proxyproto; crates/zuppo/src/ssh.rs only reads the exact bytes it asks for from the socket.

Bundles stay on HTTPS

F14 keeps SSH clones' bundle downloads on HTTPS from R2, so Spectrum's per-GB SSH price covers negotiation and packs only. The bridge does not change bundle-uri (SRV-6); that an SSH clone takes that path is the plan's design and is not measured here.

Test it

Locally, with no Cloudflare:

sh
scripts/conform-zuppo.sh ssh-bridge     # git and git-v0 client cells over SSH behind a proxy
cargo test -p zuppo --test ssh          # the header, the trust list, refusals
cargo test -p zuppo-proxyproto          # the decoder

scripts/spectrum-standin.py is the stand-in for Spectrum: a TCP proxy that writes a PROXY v2 header naming 203.0.113.7 before every connection. The ssh-bridge run of the conformance suite also checks that a connection straight to the origin gets no answer and that the log names the client behind the proxy.

On Cloudflare (needs a zone with Spectrum, a running bridge and the cloud deployment; see the header of the script for the environment):

sh
scripts/spectrum.sh                     # OUT/summary.json: every step true, or exit 1

It turns on the zone's HTTP/3 setting, creates the Spectrum application (tcp/22, direct to the bridge, PROXY v2), runs zuppo-conform --target cloud --http ssh through it, pushes a repository over SSH and clones it with git-remote-zuppo over HTTP/3, then deletes the application.

HTTP/3 downloads

Cloudflare speaks HTTP/3 to clients on every plan, never to the origin (TRN-3). Stock git cannot ask for it, so the own client does: git-remote-zuppo (ZUPPO_HTTP_VERSION=auto moves to HTTP/3 after an answer carries Alt-Svc: h3=…, or force it with HTTP/3). Nothing runs at the edge for it. Local proof is SRV-6's: the tls-helper run of scripts/conform-zuppo.sh and scripts/pc36-h3.sh against zuppo serve --http3; the cloud step is the last one of scripts/spectrum.sh.