help with subdomain #79

Closed
opened 2018-02-03 12:29:51 +00:00 by coffeeboy7411 · 1 comment
coffeeboy7411 commented 2018-02-03 12:29:51 +00:00 (Migrated from github.com)

try to set subdomain in the api , the it always failed and prompt: ( P.S. it works fine in command line)

TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
at Url.parse (url.js:106:11)
at Object.urlParse [as parse] (url.js:100:13)
at Tunnel._init (/Users/tony/Desktop/Brainstation/Lab/restDemo/node_modules/localtunnel/lib/Tunnel.js:36:24)
at Tunnel.open (/Users/tony/Desktop/Brainstation/Lab/restDemo/node_modules/localtunnel/lib/Tunnel.js:138:10)
at localtunnel (/Users/tony/Desktop/Brainstation/Lab/restDemo/node_modules/localtunnel/client.js:16:12)
at Object. (/Users/tony/Desktop/Brainstation/Lab/restDemo/studentExample.js:145:14)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)

The api code below:
var tunnel = localtunnel('8080', 'testcoffeeboy', function (err, tunnel) {
if (err) {
console.log(err)
}

tunnel.url
console.log(tunnel.url)

});

tunnel.on('close', function () {

});

try to set subdomain in the api , the it always failed and prompt: ( P.S. it works fine in command line) TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined at Url.parse (url.js:106:11) at Object.urlParse [as parse] (url.js:100:13) at Tunnel._init (/Users/tony/Desktop/Brainstation/Lab/restDemo/node_modules/localtunnel/lib/Tunnel.js:36:24) at Tunnel.open (/Users/tony/Desktop/Brainstation/Lab/restDemo/node_modules/localtunnel/lib/Tunnel.js:138:10) at localtunnel (/Users/tony/Desktop/Brainstation/Lab/restDemo/node_modules/localtunnel/client.js:16:12) at Object.<anonymous> (/Users/tony/Desktop/Brainstation/Lab/restDemo/studentExample.js:145:14) at Module._compile (module.js:641:30) at Object.Module._extensions..js (module.js:652:10) at Module.load (module.js:560:32) at tryModuleLoad (module.js:503:12) The api code below: var tunnel = localtunnel('8080', 'testcoffeeboy', function (err, tunnel) { if (err) { console.log(err) } tunnel.url console.log(tunnel.url) }); tunnel.on('close', function () { });
William-An commented 2018-03-03 03:26:57 +00:00 (Migrated from github.com)

The opts param in tunnel class should be an object but not a string. You can try to delete the 'testcoffeeby' or use {subdomain:'testcoffeeby'} instead.

btw. This repo is for localtunnel-server not localtunnel. You should refer to https://github.com/localtunnel/localtunnel/issues for help.

The `opts` param in tunnel class should be an `object` but not a string. You can try to delete the `'testcoffeeby'` or use `{subdomain:'testcoffeeby'}` instead. btw. This repo is for `localtunnel-server` not `localtunnel`. You should refer to https://github.com/localtunnel/localtunnel/issues for help.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hoelee/server#79