ops(relay): bridge production traffic to Fly

This commit is contained in:
Mohamed Boudra
2026-07-11 16:49:15 +02:00
parent c800c6a3f1
commit 5ae53c7e55
5 changed files with 117 additions and 2 deletions
+6
View File
@@ -17,6 +17,7 @@
* ```
*/
import { createCutoverProxy } from "./cutover-proxy.js";
import type { ConnectionRole, RelaySessionAttachment } from "./types.js";
type RelayProtocolVersion = "1" | "2";
@@ -97,6 +98,7 @@ function getGlobalWebSocketPair(): (new () => WebSocketPair) | undefined {
interface Env {
RELAY: DurableObjectNamespace;
PASEO_RELAY_UPSTREAM?: string;
}
interface DurableObjectNamespace {
@@ -572,6 +574,10 @@ export class RelayDurableObject {
*/
export default {
async fetch(request: Request, env: Env): Promise<Response> {
if (env.PASEO_RELAY_UPSTREAM) {
return createCutoverProxy(env.PASEO_RELAY_UPSTREAM).fetch(request);
}
const url = new URL(request.url);
// Health check