@mongodb-js/devtools-proxy-support
Advanced tools
Comparing version 0.3.5 to 0.3.6
@@ -18,3 +18,3 @@ "use strict"; | ||
emitter.on('socks5:forwarding-error', (ev) => { | ||
log.error('DEVTOOLS-PROXY', mongoLogId(1_001_000_259), `socks5-${logCtx}`, 'Failed to establish new SSH connection', { ...ev }); | ||
log.error('DEVTOOLS-PROXY', mongoLogId(1_001_000_259), `socks5-${logCtx}`, 'Failed to establish new outgoing connection from Socks5 proxy', { ...ev }); | ||
}); | ||
@@ -52,3 +52,3 @@ emitter.on('socks5:agent-initialized', () => { | ||
emitter.on('ssh:failed-forward', (ev) => { | ||
log.error('DEVTOOLS-PROXY', mongoLogId(1_001_000_261), `ssh-${logCtx}`, 'Error forwarding Socks5 request, retrying', { | ||
log.error('DEVTOOLS-PROXY', mongoLogId(1_001_000_261), `ssh-${logCtx}`, 'Error forwarding outbound SSH connection, potentially retrying', { | ||
...ev, | ||
@@ -55,0 +55,0 @@ }); |
@@ -51,6 +51,15 @@ "use strict"; | ||
const req = createFakeHttpClientRequest(dstAddr, dstPort, overrideProtocol); | ||
req.onSocket = (sock) => { | ||
if (sock) | ||
req.on('error', reject); | ||
const done = (error, sock) => { | ||
req.off('error', reject); | ||
if (error) | ||
reject(error); | ||
else if (sock) | ||
resolve(sock); | ||
else | ||
reject(new Error('Received neither error object nor socket from agent.createSocket()')); | ||
}; | ||
req.onSocket = (sock, err) => { | ||
done(err, sock); | ||
}; | ||
agent.createSocket(req, { | ||
@@ -60,8 +69,3 @@ host: dstAddr, | ||
}, (err, sock) => { | ||
if (err) | ||
reject(err); | ||
else if (sock) | ||
resolve(sock); | ||
else | ||
reject(new Error('Received neither error object nor socket from agent.createSocket()')); | ||
done(err, sock); | ||
}); | ||
@@ -68,0 +72,0 @@ }); |
@@ -16,3 +16,3 @@ { | ||
"homepage": "https://github.com/mongodb-js/devtools-shared", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"repository": { | ||
@@ -92,3 +92,3 @@ "type": "git", | ||
}, | ||
"gitHead": "79bf30a7a16bd0cc85a2c45771cad16733971c6a" | ||
"gitHead": "287d178b1f2e6c2bf641f0fec00c04d7adc2ca2f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
116570
1358