mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-13 13:35:54 +00:00
change main export signature to localtunnel(port, opt, fn)
Makes for a simpler hello world app
This commit is contained in:
16
bin/client
16
bin/client
@@ -25,15 +25,17 @@ var opt = {
|
||||
subdomain: argv.subdomain,
|
||||
}
|
||||
|
||||
var client = lt_client.connect(opt);
|
||||
lt_client(opt.port, opt, function(err, tunnel) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return process.exit(1);
|
||||
}
|
||||
|
||||
// only emitted when the url changes
|
||||
client.on('url', function(url) {
|
||||
console.log('your url is: %s', url);
|
||||
});
|
||||
console.log('your url is: %s', tunnel.url);
|
||||
|
||||
client.on('error', function(err) {
|
||||
console.error(err);
|
||||
tunnel.on('error', function(err) {
|
||||
console.error(err);
|
||||
});
|
||||
});
|
||||
|
||||
// vim: ft=javascript
|
||||
|
||||
Reference in New Issue
Block a user