@tramvai/module-http-proxy-agent 2.119.2 → 2.119.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,10 +26,10 @@ const addProxyToHttpsAgent = ({ logger, metrics, }) => {
26
26
  proxy,
27
27
  });
28
28
  // @ts-expect-error
29
- const originalCreateConnection = https.globalAgent.createConnection;
29
+ const originalCreateConnection = https.Agent.prototype.createConnection;
30
30
  // @ts-expect-error
31
- https.globalAgent.createConnection = createConnection;
32
- function createConnection(options, cb) {
31
+ https.Agent.prototype.createConnection = createProxiedConnection;
32
+ function createProxiedConnection(options, cb) {
33
33
  const { hostname, href, method, headers } = options;
34
34
  const connectionMustBeProxied = !noProxyEnv || !matchNoProxyWithCache({ hostname });
35
35
  if (connectionMustBeProxied) {
@@ -35,10 +35,10 @@ const addProxyToHttpsAgent = ({ logger, metrics, }) => {
35
35
  proxy,
36
36
  });
37
37
  // @ts-expect-error
38
- const originalCreateConnection = https__default["default"].globalAgent.createConnection;
38
+ const originalCreateConnection = https__default["default"].Agent.prototype.createConnection;
39
39
  // @ts-expect-error
40
- https__default["default"].globalAgent.createConnection = createConnection;
41
- function createConnection(options, cb) {
40
+ https__default["default"].Agent.prototype.createConnection = createProxiedConnection;
41
+ function createProxiedConnection(options, cb) {
42
42
  const { hostname, href, method, headers } = options;
43
43
  const connectionMustBeProxied = !noProxyEnv || !matchNoProxyWithCache({ hostname });
44
44
  if (connectionMustBeProxied) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-http-proxy-agent",
3
- "version": "2.119.2",
3
+ "version": "2.119.4",
4
4
  "description": "Enable support for http_proxy, https_proxy and no_proxy env variables",
5
5
  "browser": "lib/browser.js",
6
6
  "main": "lib/server.js",
@@ -23,13 +23,13 @@
23
23
  "registry": "https://registry.npmjs.org/"
24
24
  },
25
25
  "dependencies": {
26
- "@tramvai/tokens-common": "2.119.2"
26
+ "@tramvai/tokens-common": "2.119.4"
27
27
  },
28
28
  "devDependencies": {},
29
29
  "peerDependencies": {
30
- "@tramvai/core": "2.119.2",
30
+ "@tramvai/core": "2.119.4",
31
31
  "@tinkoff/dippy": "0.8.15",
32
- "@tramvai/tokens-metrics": "2.119.2",
32
+ "@tramvai/tokens-metrics": "2.119.4",
33
33
  "tslib": "^2.4.0"
34
34
  }
35
35
  }