Edge Proxy Relay
-Forward HTTP and WebSocket requests to any target server via the x-relay-target header.
Edge Proxy Relay
+Forward HTTP and WebSocket requests to any target server via the x-relay-target header.
Endpoints
+Endpoints
-GET /health
-Health check. Returns 200 OK with server status, uptime, and version.
-GET /health
+Health check. Returns 200 OK with server status, uptime, and version.
+GET /docs
-This page.
-GET /docs
+This page.
+Any Path (Catch-all Relay)
-Send a request with the x-relay-target header and this proxy forwards it.
Any Path (Catch-all Relay)
+Send a request with the x-relay-target header and this proxy forwards it.
Usage — HTTP Relay
-curl -s \\
- -H "x-relay-target: https://httpbin.org" \\
- -H "x-relay-path: /get" \\
- "https://your-proxy.example/any/path"
- | Header | Required | Description |
|---|---|---|
x-relay-target | Yes | Base URL of the upstream (http:// or https://) |
x-relay-path | No | Path to append (default: /) |
Usage — HTTP Relay
+curl -s \\
+ -H "x-relay-target: https://httpbin.org" \\
+ -H "x-relay-path: /get" \\
+ "https://your-proxy.example/any/path"
+ | Header | Required | Description |
|---|---|---|
x-relay-target | Yes | Base URL of the upstream (http:// or https://) |
x-relay-path | No | Path to append (default: /) |
Usage — WebSocket Relay
-const ws = new WebSocket("wss://your-proxy.example/relay", {
- headers: { "x-relay-target": "wss://echo-websocket.example" },
-});
-ws.onopen = () => ws.send("Hello via relay!");
-ws.onmessage = (e) => console.log("Got:", e.data);
+ Usage — WebSocket Relay
+const ws = new WebSocket("wss://your-proxy.example/relay", {
+ headers: { "x-relay-target": "wss://echo-websocket.example" },
+ });
+ ws.onopen = () => ws.send("Hello via relay!");
+ ws.onmessage = (e) => console.log("Got:", e.data);
- Status Codes
-| Code | Meaning |
|---|---|
| 204 | CORS preflight success (OPTIONS) |
| 400 | Missing x-relay-target header |
| 403 | Target blocked (SSRF protection / not allowed) |
| 413 | Request body exceeds size limit |
| 429 | Rate limit exceeded |
| 502 | Upstream network / DNS error |
| 504 | Upstream timeout |
Status Codes
+| Code | Meaning |
|---|---|
| 204 | CORS preflight success (OPTIONS) |
| 400 | Missing x-relay-target header |
| 403 | Target blocked (SSRF protection / not allowed) |
| 413 | Request body exceeds size limit |
| 429 | Rate limit exceeded |
| 502 | Upstream network / DNS error |
| 504 | Upstream timeout |