Skip to content

Commit 7eb36d5

Browse files
test
1 parent ace8ee1 commit 7eb36d5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/mongoPatch.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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
};

0 commit comments

Comments
 (0)