mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-17 23:45:54 +00:00
when remote endpoint has an error, just close it
This commit is contained in:
@@ -77,19 +77,14 @@ TunnelCluster.prototype.open = function() {
|
|||||||
port: remote_port
|
port: remote_port
|
||||||
});
|
});
|
||||||
|
|
||||||
remote.once('error', function(err) {
|
remote.on('error', function(err) {
|
||||||
// emit connection refused errors immediately, because they
|
// emit connection refused errors immediately, because they
|
||||||
// indicate that the tunnel can't be established.
|
// indicate that the tunnel can't be established.
|
||||||
if (err.code === 'ECONNREFUSED') {
|
if (err.code === 'ECONNREFUSED') {
|
||||||
self.emit('error', new Error('connection refused: ' + remote_host + ':' + remote_port + ' (check your firewall settings)'));
|
self.emit('error', new Error('connection refused: ' + remote_host + ':' + remote_port + ' (check your firewall settings)'));
|
||||||
}
|
}
|
||||||
else if (err.code !== 'ETIMEDOUT') {
|
|
||||||
self.emit('error', err);
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(function() {
|
remote.end();
|
||||||
self.emit('dead');
|
|
||||||
}, 1000);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function conn_local() {
|
function conn_local() {
|
||||||
|
|||||||
Reference in New Issue
Block a user