Skip to content

Commit 47823b0

Browse files
authored
Merge pull request #560 from Azure/swa-start-perf-boost
fix(start): keep connection open with http-proxy
2 parents 06356c1 + 7e021c7 commit 47823b0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/msha/server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ import { handleUserConfig, onConnectionLost, requestMiddleware } from "./middlew
1515

1616
const { SWA_CLI_PORT } = swaCLIEnv();
1717

18-
const proxyApp = httpProxy.createProxyServer({ autoRewrite: true });
18+
const proxyApp = httpProxy.createProxyServer({
19+
autoRewrite: true,
20+
agent: new http.Agent({
21+
keepAlive: true,
22+
keepAliveMsecs: 5000,
23+
}),
24+
});
1925

2026
if (!isHttpUrl(SWA_CLI_API_URI())) {
2127
logger.error(`The provided API URI ${SWA_CLI_API_URI} is not a valid. Exiting.`, true);

0 commit comments

Comments
 (0)