File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
packages/node/src/transports Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 11import { Event , Response , TransportOptions } from '@sentry/types' ;
22import { SentryError } from '@sentry/utils' ;
33import * as http from 'http' ;
4- import * as HttpsProxyAgent from 'https-proxy-agent' ;
54
65import { 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
Original file line number Diff line number Diff line change 11import { Event , Response , TransportOptions } from '@sentry/types' ;
22import { SentryError } from '@sentry/utils' ;
33import * as https from 'https' ;
4- import * as HttpsProxyAgent from 'https-proxy-agent' ;
54
65import { 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
You can’t perform that action at this time.
0 commit comments