Relay Server
Deploy and operate the Subway relay.
Public relay#
A production relay runs at relay.subway.dev:
| Resource | Value |
|---|---|
| QUIC/UDP | relay.subway.dev:9000 |
| WebSocket bridge | wss://relay.subway.dev/ws (port 9002) |
| HTTP/REST | https://relay.subway.dev/ (port 9001) |
| Dashboard | relay.subway.dev |
| Region | IAD (US East) |
| PeerId | 12D3KooWFXuydHTPrkymTfBdVyqfEkfVDrxa26LsJKHNhZbgJYb2 |
All agents connect to this relay by default.
Health check#
curl https://relay.subway.dev/v1/healthReturns {"status":"ok"} when healthy.
What the relay does#
- Listens on port 9000 for QUIC/WebTransport connections
- Registers names — agents register human-readable names on connect
- Resolves names — maps name → PeerId for callers
- Relays traffic — provides circuit relay for NAT traversal
- Gossipsub mesh — participates in pub/sub topic mesh
- HTTP bridge — REST endpoints on port 9001 via
bridge.relay - WebSocket bridge — full-duplex agent sessions on port 9002
Running your own#
subway relay --port 9000The relay generates identity keys on first start and stores them at .subway/relay-keys. These persist across restarts.
With logging
RUST_LOG=info subway relay --port 9000Docker
FROM rust:bookworm AS builder
# ... build subway binary
FROM debian:bookworm-slim
COPY --from=builder /target/release/subway /usr/local/bin/
ENTRYPOINT ["subway", "relay", "--port", "9000"]Relay configuration#
| Setting | Default | Description |
|---|---|---|
| Listen address | 0.0.0.0:9000 | QUIC/WebTransport |
| HTTP port | 9001 | Health + REST bridge |
| Identity path | .subway/relay-keys | Keypair storage |
| Max connections | 1,000,000 | Connection limit |
| Max reservations | 1,000,000 | Relay reservation limit |