Skip to content

Commit c750a23

Browse files
author
EspressoTrip-v2
committed
add existing socket to mongo proxy
1 parent d3b0e04 commit c750a23

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/mongoPatch.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ interface Config {
1616
export function useProxyForMongo(config: Config) {
1717
let sockets: tls.TLSSocket[] = [];
1818
socks.SocksClient.createConnection = async (options, callback) => {
19-
options.existing_socket?.destroy();
20-
const socket = await new HttpsProxySocket(`https://${config.proxy}`, { auth: config.auth }).connect({
19+
const socket = await new HttpsProxySocket({ socket: options.existing_socket }, { auth: config.auth }).connect({
2120
host: options.destination.host,
2221
port: options.destination.port,
2322
});

0 commit comments

Comments
 (0)