File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -17,19 +17,20 @@ export function useProxyForMongo(config: Config) {
1717 socks . SocksClient . createConnection = async ( options , callback ) => {
1818 const proxy = new HttpsProxySocket ( `https://${ config . proxy } ` , { auth : config . auth } ) ;
1919 const socket = await proxy . connect ( { host : options . destination . host , port : options . destination . port } ) ;
20- sockets . push ( socket )
20+ sockets . push ( socket ) ;
2121 return {
22- socket
22+ socket,
2323 } ;
2424 } ;
2525 return {
2626 close : async ( ) => {
2727 console . log ( `Closing ${ sockets . length } open proxy sockets` ) ;
2828 for ( const socket of sockets ) {
2929 await new Promise ( ( resolve , reject ) => {
30+ socket . setKeepAlive ( false ) ;
3031 socket . once ( 'close' , ( ) => resolve ) ;
31- socket . end ( )
32- } )
32+ socket . end ( ) ;
33+ } ) ;
3334 }
3435 } ,
3536 } ;
You can’t perform that action at this time.
0 commit comments