We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ace8ee1 commit 7eb36d5Copy full SHA for 7eb36d5
1 file changed
src/mongoPatch.ts
@@ -17,19 +17,20 @@ export function useProxyForMongo(config: Config) {
17
socks.SocksClient.createConnection = async (options, callback) => {
18
const proxy = new HttpsProxySocket(`https://${config.proxy}`, { auth: config.auth });
19
const socket = await proxy.connect({ host: options.destination.host, port: options.destination.port });
20
- sockets.push(socket)
+ sockets.push(socket);
21
return {
22
- socket
+ socket,
23
};
24
25
26
close: async () => {
27
console.log(`Closing ${sockets.length} open proxy sockets`);
28
for (const socket of sockets) {
29
await new Promise((resolve, reject) => {
30
+ socket.setKeepAlive(false);
31
socket.once('close', () => resolve);
- socket.end()
32
- })
+ socket.end();
33
+ });
34
}
35
},
36
0 commit comments