vscode-proxy-agent
Advanced tools
Comparing version 0.10.0 to 0.11.0
# Change Log | ||
Notable changes will be documented here. | ||
## [0.11.0] | ||
- Override original agent again (fixes [microsoft/vscode#117054](https://github.com/microsoft/vscode/issues/117054)) | ||
## [0.10.0] | ||
@@ -5,0 +8,0 @@ - Do not override original agent (forward port [microsoft/vscode#120354](https://github.com/microsoft/vscode/issues/120354)) |
@@ -46,4 +46,5 @@ /// <reference types="node" /> | ||
}, req: http.ClientRequest, opts: http.RequestOptions, url: string, callback: (proxy?: string | undefined) => void) => void; | ||
export declare type ProxySupportSetting = 'override' | 'fallback' | 'on' | 'off'; | ||
export declare function createHttpPatch(originals: typeof http | typeof https, resolveProxy: ReturnType<typeof createProxyResolver>, proxySetting: { | ||
config: 'override' | 'on' | 'off'; | ||
config: ProxySupportSetting; | ||
}, certSetting: { | ||
@@ -50,0 +51,0 @@ config: boolean; |
@@ -274,3 +274,3 @@ "use strict"; | ||
const config = onRequest && (options._vscodeProxySupport || /* LS */ options._vscodeSystemProxy) || proxySetting.config; | ||
const useProxySettings = !optionsPatched && (config === 'override' || config === 'on' && originalAgent === undefined); | ||
const useProxySettings = !optionsPatched && (config === 'override' || config === 'fallback' || (config === 'on' && originalAgent === undefined)); | ||
const useSystemCertificates = !optionsPatched && certSetting.config && isHttps && !options.ca; | ||
@@ -295,3 +295,5 @@ if (useProxySettings || useSystemCertificates) { | ||
const resolveP = (req, opts, url) => new Promise(resolve => resolveProxy({ useProxySettings, useSystemCertificates }, req, opts, url, resolve)); | ||
options.agent = agent_1.default(resolveP, { originalAgent }); | ||
const host = options.hostname || options.host; | ||
const isLocalhost = !host || host === 'localhost' || host === '127.0.0.1'; // Avoiding https://github.com/microsoft/vscode/issues/120354 | ||
options.agent = agent_1.default(resolveP, { originalAgent: (!useProxySettings || isLocalhost || config === 'fallback') ? originalAgent : undefined }); | ||
return original(options, callback); | ||
@@ -298,0 +300,0 @@ } |
{ | ||
"name": "vscode-proxy-agent", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "NodeJS http(s) agent implementation for VS Code", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54986
721