mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-14 22:15:55 +00:00
Merge pull request #27 from adammck/couldnt-establish-tunnel
Add more verbose error for ECONNREFUSED
This commit is contained in:
@@ -62,7 +62,13 @@ var connect = function(opt) {
|
||||
var remote = net.connect(remote_opt);
|
||||
|
||||
remote.once('error', function(err) {
|
||||
if (err.code !== 'ECONNREFUSED') {
|
||||
|
||||
// emit connection refused errors immediately, because they
|
||||
// indicate that the tunnel can't be established.
|
||||
if (err.code === 'ECONNREFUSED') {
|
||||
ev.emit('error', new Error('connection refused: ' + remote_host + ':' + remote_port + ' (check your firewall settings)'));
|
||||
}
|
||||
else {
|
||||
remote.emit('error', err);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user