Skip to content

Commit 09b24be

Browse files
committed
Update proxy-agent usage
1 parent 1d525ce commit 09b24be

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
@@ -4,7 +4,7 @@ import * as https from "https"
44
import ProxyAgent from "proxy-agent"
55
import * as semver from "semver"
66
import * as url from "url"
7-
import { httpProxyUri, version } from "./constants"
7+
import { version } from "./constants"
88
import { SettingsProvider, UpdateSettings } from "./settings"
99

1010
export interface Update {
@@ -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)