2 Commits

Author SHA1 Message Date
Roman Shtylman
e5b04a395b 1.4.1 2014-10-25 17:12:10 -07:00
Roman Shtylman
9bdb40e97c when remote endpoint has an error, just close it 2014-10-25 17:05:19 -07:00
2 changed files with 4 additions and 9 deletions

View File

@@ -77,19 +77,14 @@ TunnelCluster.prototype.open = function() {
port: remote_port
});
remote.once('error', function(err) {
remote.on('error', function(err) {
// emit connection refused errors immediately, because they
// indicate that the tunnel can't be established.
if (err.code === 'ECONNREFUSED') {
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() {
self.emit('dead');
}, 1000);
remote.end();
});
function conn_local() {

View File

@@ -2,7 +2,7 @@
"author": "Roman Shtylman <shtylman@gmail.com>",
"name": "localtunnel",
"description": "expose localhost to the world",
"version": "1.4.0",
"version": "1.4.1",
"repository": {
"type": "git",
"url": "git://github.com/shtylman/localtunnel.git"
@@ -22,4 +22,4 @@
"lt": "./bin/client"
},
"main": "./client.js"
}
}