mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
add --domain option to enable localtunnel servers on subdomains
This commit is contained in:
11
server.js
11
server.js
@@ -9,13 +9,16 @@ import ClientManager from './lib/ClientManager';
|
||||
|
||||
const debug = Debug('localtunnel:server');
|
||||
|
||||
function GetClientIdFromHostname(hostname) {
|
||||
return tldjs.getSubdomain(hostname);
|
||||
}
|
||||
|
||||
export default function(opt) {
|
||||
opt = opt || {};
|
||||
|
||||
const validHosts = (opt.domain) ? [opt.domain] : undefined;
|
||||
const myTldjs = tldjs.fromUserSettings({ validHosts });
|
||||
|
||||
function GetClientIdFromHostname(hostname) {
|
||||
return myTldjs.getSubdomain(hostname);
|
||||
}
|
||||
|
||||
const manager = new ClientManager(opt);
|
||||
|
||||
const schema = opt.secure ? 'https' : 'http';
|
||||
|
||||
Reference in New Issue
Block a user