From d400387cb1088552f78c99355334a55b78b6c17b Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Sun, 11 Aug 2024 19:19:18 +0800 Subject: [PATCH] fix: expose supervisor websocket via Kong api (#2603) --- internal/start/start.go | 2 ++ internal/start/templates/kong.yml | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/internal/start/start.go b/internal/start/start.go index 7e27291ae..64c5e2447 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -105,6 +105,7 @@ type kongConfig struct { PgmetaId string EdgeRuntimeId string LogflareId string + PoolerId string ApiHost string ApiPort uint16 } @@ -350,6 +351,7 @@ EOF PgmetaId: utils.PgmetaId, EdgeRuntimeId: utils.EdgeRuntimeId, LogflareId: utils.LogflareId, + PoolerId: utils.PoolerId, ApiHost: utils.Config.Hostname, ApiPort: utils.Config.Api.Port, }); err != nil { diff --git a/internal/start/templates/kong.yml b/internal/start/templates/kong.yml index d1a81676e..6927edde1 100644 --- a/internal/start/templates/kong.yml +++ b/internal/start/templates/kong.yml @@ -140,3 +140,14 @@ services: strip_path: true paths: - /analytics/v1/ + - name: pooler-v2-ws + _comment: "Pooler: /pooler/v2/* -> ws://pooler:4000/v2/*" + url: http://{{ .PoolerId }}:4000/v2 + protocol: ws + routes: + - name: pooler-v2-ws + strip_path: true + paths: + - /pooler/v2/ + plugins: + - name: cors