diff --git a/src/lib/haproxy/index.ts b/src/lib/haproxy/index.ts index b9a8e9581..3f1176432 100644 --- a/src/lib/haproxy/index.ts +++ b/src/lib/haproxy/index.ts @@ -161,7 +161,7 @@ export async function startTraefikTCPProxy( image: 'traefik:v2.6', command: [ `--entrypoints.tcp.address=:${publicPort}`, - `--providers.http.endpoint=${otherTraefikEndpoint}?id=${id}&privatePort=${privatePort}&publicPort=${publicPort}&type=tcp`, + `--providers.http.endpoint=${otherTraefikEndpoint}?id=${id}&privatePort=${privatePort}&publicPort=${publicPort}&type=tcp&address=${dependentId}`, '--providers.http.pollTimeout=2s', '--log.level=error' ], diff --git a/src/routes/webhooks/traefik/other.json.ts b/src/routes/webhooks/traefik/other.json.ts index a1c357878..3dc4d0e59 100644 --- a/src/routes/webhooks/traefik/other.json.ts +++ b/src/routes/webhooks/traefik/other.json.ts @@ -9,6 +9,7 @@ export const get: RequestHandler = async (event) => { const privatePort = event.url.searchParams.get('privatePort'); const publicPort = event.url.searchParams.get('publicPort'); const type = event.url.searchParams.get('type'); + const address = event.url.searchParams.get('address') || id; let traefik = {}; if (publicPort && type && privatePort) { if (type === 'tcp') { @@ -24,7 +25,7 @@ export const get: RequestHandler = async (event) => { services: { [id]: { loadbalancer: { - servers: [{ address: `${id}:${privatePort}` }] + servers: [{ address: `${address}:${privatePort}` }] } } }