@@ -24,7 +24,7 @@ commander.version(process.env.VERSION || "development")
24
24
. option ( "-e, --extensions-dir <dir>" , "Set the root path for extensions." )
25
25
. option ( "-d --user-data-dir <dir>" , " Specifies the directory that user data is kept in, useful when running as root." )
26
26
. option ( "--data-dir <value>" , "DEPRECATED: Use '--user-data-dir' instead. Customize where user-data is stored." )
27
- . option ( "-h, --host <value>" , "Customize the hostname." , "127 .0.0.1 " )
27
+ . option ( "-h, --host <value>" , "Customize the hostname." , "0 .0.0.0 " )
28
28
. option ( "-o, --open" , "Open in the browser on startup." , false )
29
29
. option ( "-p, --port <number>" , "Port to bind on." , 8443 )
30
30
. option ( "-N, --no-auth" , "Start without requiring authentication." , undefined )
@@ -50,7 +50,7 @@ const bold = (text: string | number): string | number => {
50
50
const options = commander . opts ( ) as {
51
51
noAuth : boolean ;
52
52
readonly allowHttp : boolean ;
53
- readonly host : string ;
53
+ host : string ;
54
54
readonly port : number ;
55
55
56
56
readonly userDataDir ?: string ;
@@ -235,8 +235,13 @@ const bold = (text: string | number): string | number => {
235
235
} : undefined ,
236
236
} ) ;
237
237
238
- logger . info ( "Starting webserver..." , field ( "host" , options . host ) , field ( "port" , options . port ) ) ;
239
- app . server . listen ( options . port , options . host ) ;
238
+ if ( options . noAuth || options . allowHttp ) {
239
+ logger . info ( "Starting webserver..." , field ( "host" , "127.0.0.1" ) , field ( "port" , options . port ) ) ;
240
+ app . server . listen ( options . port , "127.0.0.1" ) ;
241
+ } else {
242
+ logger . info ( "Starting webserver..." , field ( "host" , options . host ) , field ( "port" , options . port ) ) ;
243
+ app . server . listen ( options . port , options . host ) ;
244
+ }
240
245
let clientId = 1 ;
241
246
app . wss . on ( "connection" , ( ws , req ) => {
242
247
const id = clientId ++ ;
0 commit comments