Skip to content

Commit 132f7d1

Browse files
committed
Default keepAlive to true for proxy agent
1 parent 8c65ff8 commit 132f7d1

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

patches/keepalive.diff

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
This can be removed after upgrading to Node >= 19 as keepAlive is defaulted to
2+
true after 19.
3+
4+
Index: code-server/lib/vscode/src/vs/platform/request/node/proxy.ts
5+
===================================================================
6+
--- code-server.orig/lib/vscode/src/vs/platform/request/node/proxy.ts
7+
+++ code-server/lib/vscode/src/vs/platform/request/node/proxy.ts
8+
@@ -42,6 +42,7 @@ export async function getProxyAgent(rawR
9+
port: (proxyEndpoint.port ? +proxyEndpoint.port : 0) || (proxyEndpoint.protocol === 'https' ? 443 : 80),
10+
auth: proxyEndpoint.auth,
11+
rejectUnauthorized: isBoolean(options.strictSSL) ? options.strictSSL : true,
12+
+ keepAlive: true,
13+
};
14+
15+
return requestURL.protocol === 'http:'

patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ display-language.diff
1919
cli-window-open.diff
2020
getting-started.diff
2121
safari.diff
22+
keepalive.diff

src/node/update.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export class UpdateProvider {
105105
logger.debug("Making request", field("uri", uri))
106106
const isHttps = uri.startsWith("https")
107107
const agent = new ProxyAgent({
108+
keepAlive: true,
108109
getProxyForUrl: () => httpProxyUri || "",
109110
})
110111
const httpx = isHttps ? https : http

0 commit comments

Comments
 (0)