Skip to content

Commit 725b3fd

Browse files
committed
Fix HttpsProxyAgent creation and avoid deprecated call
1 parent bff377c commit 725b3fd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

editors/code/src/net.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import * as zlib from "zlib";
99
import * as util from "util";
1010
import * as path from "path";
1111
import { log, assert } from "./util";
12-
import * as url from "url";
1312
import * as https from "https";
1413
import { ProxySettings } from "./config";
1514

@@ -21,7 +20,7 @@ const REPO = "rust-analyzer";
2120

2221
function makeHttpAgent(proxy: string | null | undefined, options?: https.AgentOptions) {
2322
if (proxy) {
24-
return new HttpsProxyAgent(proxy, { ...options, ...url.parse(proxy) });
23+
return new HttpsProxyAgent({ ...options, ...new URL(proxy) });
2524
} else {
2625
return new https.Agent(options);
2726
}

0 commit comments

Comments
 (0)