Default keepAlive to true for proxy agent
This commit is contained in:
parent
8c65ff8d0d
commit
132f7d1470
15
patches/keepalive.diff
Normal file
15
patches/keepalive.diff
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
This can be removed after upgrading to Node >= 19 as keepAlive is defaulted to
|
||||||
|
true after 19.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/platform/request/node/proxy.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/platform/request/node/proxy.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/platform/request/node/proxy.ts
|
||||||
|
@@ -42,6 +42,7 @@ export async function getProxyAgent(rawR
|
||||||
|
port: (proxyEndpoint.port ? +proxyEndpoint.port : 0) || (proxyEndpoint.protocol === 'https' ? 443 : 80),
|
||||||
|
auth: proxyEndpoint.auth,
|
||||||
|
rejectUnauthorized: isBoolean(options.strictSSL) ? options.strictSSL : true,
|
||||||
|
+ keepAlive: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
return requestURL.protocol === 'http:'
|
@ -19,3 +19,4 @@ display-language.diff
|
|||||||
cli-window-open.diff
|
cli-window-open.diff
|
||||||
getting-started.diff
|
getting-started.diff
|
||||||
safari.diff
|
safari.diff
|
||||||
|
keepalive.diff
|
||||||
|
@ -105,6 +105,7 @@ export class UpdateProvider {
|
|||||||
logger.debug("Making request", field("uri", uri))
|
logger.debug("Making request", field("uri", uri))
|
||||||
const isHttps = uri.startsWith("https")
|
const isHttps = uri.startsWith("https")
|
||||||
const agent = new ProxyAgent({
|
const agent = new ProxyAgent({
|
||||||
|
keepAlive: true,
|
||||||
getProxyForUrl: () => httpProxyUri || "",
|
getProxyForUrl: () => httpProxyUri || "",
|
||||||
})
|
})
|
||||||
const httpx = isHttps ? https : http
|
const httpx = isHttps ? https : http
|
||||||
|
Reference in New Issue
Block a user