diff --git a/src/gateway/portals/portal-http-proxy.ts b/src/gateway/portals/portal-http-proxy.ts index b19fde225ee5..aa4a0fa8003e 100644 --- a/src/gateway/portals/portal-http-proxy.ts +++ b/src/gateway/portals/portal-http-proxy.ts @@ -210,7 +210,8 @@ export function handlePortalProxyRequest(params: { // Next.js) often bind ::1 only, and family autoselection reaches either stack. const proxyReq = requestHttp({ hostname: "localhost", - autoSelectFamily: true, + createConnection: () => + net.connect({ host: "localhost", autoSelectFamily: true, port: target.targetPort }), port: target.targetPort, method: req.method, path: authorization.requestPath,