File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
bindings/matrix-sdk-crypto-nodejs Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 1- const { Agent } = require ( 'https' ) ;
1+ const { HttpsProxyAgent } = require ( 'https-proxy-agent ' ) ;
22const { DownloaderHelper } = require ( 'node-downloader-helper' ) ;
33const { version } = require ( "./package.json" ) ;
44const { platform, arch } = process
@@ -23,13 +23,16 @@ function download_lib(libname) {
2323 console . info ( `Downloading lib ${ libname } from ${ url } ` ) ;
2424 const dl = new DownloaderHelper ( url , __dirname , {
2525 override : true ,
26- httpsRequestOptions : {
27- // Disable keepalive to prevent the process hanging open.
28- // https://github.com/matrix-org/matrix-rust-sdk/issues/1160
29- agent : new Agent ( { keepAlive : false } ) ,
30- } ,
3126 } ) ;
3227
28+ const proxy = process . env . https_proxy ?? process . env . HTTPS_PROXY ;
29+ if ( proxy ) {
30+ const proxyAgent = new HttpsProxyAgent ( proxy ) ;
31+ dl . updateOptions ( {
32+ httpsRequestOptions : { agent : proxyAgent } ,
33+ } ) ;
34+ }
35+
3336 dl . on ( 'end' , ( ) => console . info ( 'Download Completed' ) ) ;
3437 dl . on ( 'error' , ( err ) => console . info ( 'Download Failed' , err ) ) ;
3538 dl . on ( 'progress' , stats => {
Original file line number Diff line number Diff line change 2929 "doc" : " typedoc --tsconfig ."
3030 },
3131 "dependencies" : {
32- "node-downloader-helper" : " ^2.1.1"
32+ "https-proxy-agent" : " ^5.0.1" ,
33+ "node-downloader-helper" : " ^2.1.5"
3334 }
3435}
You can’t perform that action at this time.
0 commit comments