Skip to content

Commit 8a3db83

Browse files
committed
Update proxy-agent usage
1 parent 1d525ce commit 8a3db83

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/node/update.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { field, logger } from "@coder/logger"
22
import * as http from "http"
33
import * as https from "https"
4-
import ProxyAgent from "proxy-agent"
4+
import { ProxyAgent } from "proxy-agent"
55
import * as semver from "semver"
66
import * as url from "url"
77
import { httpProxyUri, version } from "./constants"
@@ -104,7 +104,9 @@ export class UpdateProvider {
104104
const request = (uri: string): void => {
105105
logger.debug("Making request", field("uri", uri))
106106
const isHttps = uri.startsWith("https")
107-
const agent = httpProxyUri ? new ProxyAgent(httpProxyUri) : undefined
107+
const agent = new ProxyAgent({
108+
getProxyForUrl: () => httpProxyUri || "",
109+
})
108110
const httpx = isHttps ? https : http
109111
const client = httpx.get(uri, { headers: { "User-Agent": "code-server" }, agent }, (response) => {
110112
if (!response.statusCode || response.statusCode < 200 || response.statusCode >= 400) {

0 commit comments

Comments
 (0)