thrownewError("port must be specified - ex: tls:*:1337");
}
}
return{
protocol:parts[0]
,hostname:parts[1]
,port:parts[2]
};
}).forEach(memo.push);
returnmemo;
}
program
.version(pkg.version)
//.command('jsurl <url>')
.arguments('<url>')
.action(function(url){
program.url=url;
})
.option('-k --insecure','Allow TLS connections to stunneld without valid certs (H)')
.option('--locals <LINE>','comma separated list of <proto>:<//><servername>:<port> to which matching incoming http and https should forward (reverse proxy). Ex: https://john.example.com,tls:*:1337',collectProxies,[])// --reverse-proxies
.option('--stunneld <URL>','the domain (or ip address) at which you are running stunneld.js (the proxy)')// --proxy
.option('--secret','the same secret used by stunneld (used for JWT authentication)')
.option('--token','a pre-generated token for use with stunneld (instead of generating one with --secret)')
.parse(process.argv)
;
// Assumption: will not get next tcp packet unless previous packet succeeded