5 Commits

Author SHA1 Message Date
Roman Shtylman
3b67c8a8ce 1.1.2 2014-04-20 10:51:24 -04:00
Kevin Ingersoll
71552a336e Increase default Mocha timeout 2014-04-20 10:45:21 -04:00
Roman Shtylman
87a23bf28c fix status code check for url request 2014-04-19 19:33:52 -04:00
Roman Shtylman
3d54de851f handle errors from localtunnel server when requesting initial url 2014-04-19 19:30:44 -04:00
Roman Shtylman
92bb807908 fix typo
fixes #45
2014-04-18 09:34:48 -04:00
2 changed files with 8 additions and 3 deletions

View File

@@ -120,7 +120,7 @@ TunnelCluster.prototype.open = function() {
remote.removeListener('close', remote_close);
if (err.code !== 'ECONNREFUSED') {
return remove.end();
return remote.end();
}
// retrying connection to local server
@@ -199,6 +199,11 @@ Tunnel.prototype._init = function(cb) {
return setTimeout(get_url, 1000);
}
if (res.statusCode !== 200) {
var err = new Error((body && body.message) || 'localtunnel server returned an error, please try again');
return cb(err);
}
var port = body.port;
var host = upstream.hostname;

View File

@@ -2,7 +2,7 @@
"author": "Roman Shtylman <shtylman@gmail.com>",
"name": "localtunnel",
"description": "expose localhost to the world",
"version": "1.1.1",
"version": "1.1.2",
"repository": {
"type": "git",
"url": "git://github.com/shtylman/localtunnel.git"
@@ -16,7 +16,7 @@
"mocha": "~1.17.0"
},
"scripts": {
"test": "mocha --ui qunit --reporter list -- test/index.js"
"test": "mocha --ui qunit --reporter list --timeout 10000 -- test/index.js"
},
"bin": {
"lt": "./bin/client"