Skip to content

Commit 9900087

Browse files
test
1 parent e655ab6 commit 9900087

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/mongoPatch.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ interface Config {
1414
*/
1515
export function useProxyForMongo(config: Config) {
1616
const sockets: tls.TLSSocket[] = [];
17-
const proxy = new HttpsProxySocket(`https://${config.proxy}`, { auth: config.auth });
1817
socks.SocksClient.createConnection = async (options, callback) => {
18+
const proxy = new HttpsProxySocket(`https://${config.proxy}`, { auth: config.auth });
1919
const socket = await proxy.connect({ host: options.destination.host, port: options.destination.port });
2020
sockets.push(socket);
2121
return {
@@ -28,8 +28,7 @@ export function useProxyForMongo(config: Config) {
2828
for (const socket of sockets) {
2929
await new Promise((resolve, reject) => {
3030
socket.on('close', () => {
31-
console.log(`Socket ${socket.remoteAddress}: `, socket.closed);
32-
console.log('Socket is paused: ', socket.isPaused());
31+
socket.unref();
3332
resolve(true);
3433
});
3534
socket.end();

0 commit comments

Comments
 (0)