File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed
Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 1515 "scripts" : {
1616 "test" : " ts-mocha -n loader=ts-node/esm -p tsconfig.json --check-leaks src/**/*.test.ts" ,
1717 "start" : " ./bin/server" ,
18- "dev" : " nodemon -e ts,js,json --watch './src/**/*' --watch './bin/**/*' --exec './bin/server.ts --port 3000 '"
18+ "dev" : " LOG_LEVEL=debug nodemon -e ts,js,json --watch './src/**/*' --watch './bin/**/*' --exec './bin/server.ts -p 8080 -d localhost '"
1919 },
2020 "dependencies" : {
2121 "book" : " 1.3.3" ,
Original file line number Diff line number Diff line change 1- import Debug from 'debug' ;
21import http from 'http' ;
32import { hri } from 'human-readable-ids' ;
43import Koa , { Request } from 'koa' ;
@@ -26,7 +25,8 @@ export default function(opt?: LocalTunnelOpts) {
2625 const landingPage = opt . landing || 'https://localtunnel.github.io/www/' ;
2726
2827 function GetClientIdFromHostname ( hostname ) {
29- return myTldjs . getSubdomain ( hostname ) ;
28+ const pieces = hostname . split ( ':' ) ;
29+ return myTldjs . getSubdomain ( pieces [ 0 ] ) ;
3030 }
3131
3232 const manager = new ClientManager ( opt ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ type ClientManagerStats = {
1414// Manage sets of clients
1515//
1616// A client is a "user session" established to service a remote localtunnel client
17- class ClientManager {
17+ export default class ClientManager {
1818
1919 private readonly logger = newLogger ( ClientManager . name )
2020
@@ -86,8 +86,8 @@ class ClientManager {
8686 }
8787 }
8888
89- removeClient ( id ) {
90- this . logger . debug ( ' removing client: %s' , id ) ;
89+ removeClient ( id : string ) {
90+ this . logger . debug ( ` removing client: ${ id } ` ) ;
9191 const client = this . clients [ id ] ;
9292 if ( ! client ) {
9393 return ;
@@ -97,13 +97,11 @@ class ClientManager {
9797 client . close ( ) ;
9898 }
9999
100- hasClient ( id ) {
100+ hasClient ( id : string ) {
101101 return ! ! this . clients [ id ] ;
102102 }
103103
104- getClient ( id ) {
104+ getClient ( id : string ) {
105105 return this . clients [ id ] ;
106106 }
107107}
108-
109- export default ClientManager ;
You can’t perform that action at this time.
0 commit comments