Skip to content

Commit 606fc51

Browse files
committed
Merge branch 'master' of github.com:getsentry/sentry-javascript
2 parents 8d92ce3 + 18fbd73 commit 606fc51

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

packages/node/src/transports/http.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Event, Response, TransportOptions } from '@sentry/types';
22
import { SentryError } from '@sentry/utils';
33
import * as http from 'http';
4-
import * as HttpsProxyAgent from 'https-proxy-agent';
54

65
import { BaseTransport } from './base';
76

@@ -10,11 +9,10 @@ export class HTTPTransport extends BaseTransport {
109
/** Create a new instance and set this.agent */
1110
public constructor(public options: TransportOptions) {
1211
super(options);
13-
this.module = http;
1412
const proxy = options.httpProxy || process.env.http_proxy;
13+
this.module = http;
1514
this.client = proxy
16-
? // tslint:disable-next-line:no-unsafe-any
17-
(new HttpsProxyAgent(proxy) as http.Agent)
15+
? (new (require('https-proxy-agent'))(proxy) as http.Agent) // tslint:disable-line:no-unsafe-any
1816
: new http.Agent({ keepAlive: false, maxSockets: 30, timeout: 2000 });
1917
}
2018

packages/node/src/transports/https.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Event, Response, TransportOptions } from '@sentry/types';
22
import { SentryError } from '@sentry/utils';
33
import * as https from 'https';
4-
import * as HttpsProxyAgent from 'https-proxy-agent';
54

65
import { BaseTransport } from './base';
76

@@ -10,11 +9,10 @@ export class HTTPSTransport extends BaseTransport {
109
/** Create a new instance and set this.agent */
1110
public constructor(public options: TransportOptions) {
1211
super(options);
13-
this.module = https;
1412
const proxy = options.httpsProxy || options.httpProxy || process.env.https_proxy || process.env.http_proxy;
13+
this.module = https;
1514
this.client = proxy
16-
? // tslint:disable-next-line:no-unsafe-any
17-
(new HttpsProxyAgent(proxy) as https.Agent)
15+
? (new (require('https-proxy-agent'))(proxy) as https.Agent) // tslint:disable-line:no-unsafe-any
1816
: new https.Agent({ keepAlive: false, maxSockets: 30, timeout: 2000 });
1917
}
2018

0 commit comments

Comments
 (0)