- Railway relay process:
scripts/ais-relay.cjs - Desktop-product-only OpenSky relay:
api/opensky.js(not part of the public API offering) - Vercel relay proxy endpoints (legacy):
api/ais-snapshot.js,api/polymarket.js,api/rss-proxy.js
The legacy proxy endpoints in the second bullet are being phased out in favor of the sebuf proto-first approach. The OpenSky route is a restricted desktop-product transport, not a public integration surface. See Adding Endpoints for the current recommended pattern.
- Server relay callers:
server/worldmonitor/*handlers - Optional browser local fallback callers in
src/services/*
1) Minimum Production Setup
Set these before enabling strict relay auth.Railway (relay)
Vercel (proxy + server functions)
2) Full Parameter Reference
Core Relay/Auth
WITS tariff transport
The bilateral tariff handler usesWS_RELAY_URL, RELAY_SHARED_SECRET, and
RELAY_AUTH_HEADER to fetch WITS through the authenticated GET /wits route.
Without WS_RELAY_URL, it calls WITS directly. A configured relay failure remains
an upstream failure; the handler does not retry through the direct path.
The route accepts one path query parameter for TRN reported rows, MFN AVE rows,
reporter/year availability, or country/group metadata. It constructs a fixed
https://wits.worldbank.org destination, rejects redirects, and never forwards the
relay secret upstream. Requests have a nine-second deadline through body completion
and a 4 MiB response limit. Upstream status codes and XML pass through unchanged.
The relay sends no-store; the tariff handler retains its existing Redis cache,
historical year, source attribution, and tariff basis.
Deploy the relay route before the API caller when activating this transport.
The caller does not fall back to direct WITS if the relay returns 404 because its
route has not been deployed.
Relay-Adjacent Feature Flags
OpenSky Upstream Auth
OpenSky Cache/Cardinality Controls
AIS Pipeline Tuning
Rate Limit / Logging / Metrics
Platform-Managed Variables (Do Not Manually Set)
These are used only for production detection and are usually injected by platform/runtime.3) Recommended Starting Values (High Traffic Baseline)
These are safe starting points for a busy relay:4) How to Verify Configuration
Health:auth.enabledistruein/health(canonical operator-visible flag —trueonly when a shared secret is configured AND theI_UNDERSTAND_THIS_DISABLES_AUTHbypass is NOT engaged).auth.sharedSecretEnabledis preserved for back-compat./metrics.opensky.hitRatiois stable and high under load./metrics.ais.dropsPerSecstays at0in normal operation./metrics.ais.queueMaxis comfortably belowAIS_UPSTREAM_QUEUE_HARD_CAP.
