File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export class Entry extends Command {
25
25
port : flags . integer ( { char : "p" , default : 8443 , description : "Port to bind on" } ) ,
26
26
version : flags . version ( { char : "v" } ) ,
27
27
"no-auth" : flags . boolean ( { default : false } ) ,
28
+ "allow-http" : flags . boolean ( { default : false } ) ,
28
29
29
30
// Dev flags
30
31
"bootstrap-fork" : flags . string ( { hidden : true } ) ,
@@ -134,6 +135,7 @@ export class Entry extends Command {
134
135
const password = "023450wf0951" ;
135
136
const hasCustomHttps = certData && certKeyData ;
136
137
const app = await createApp ( {
138
+ allowHttp : flags [ "allow-http" ] ,
137
139
bypassAuth : flags [ "no-auth" ] ,
138
140
registerMiddleware : ( app ) : void => {
139
141
app . use ( ( req , res , next ) => {
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ interface CreateAppOptions {
26
26
serverOptions ?: ServerOptions ;
27
27
password ?: string ;
28
28
httpsOptions ?: https . ServerOptions ;
29
+ allowHttp ?: boolean ;
29
30
bypassAuth ?: boolean ;
30
31
}
31
32
@@ -187,7 +188,7 @@ export const createApp = async (options: CreateAppOptions): Promise<{
187
188
const authStaticFunc = expressStaticGzip ( path . join ( baseDir , "build/web/auth" ) ) ;
188
189
const unauthStaticFunc = expressStaticGzip ( path . join ( baseDir , "build/web/unauth" ) ) ;
189
190
app . use ( ( req , res , next ) => {
190
- if ( ! isEncrypted ( req . socket ) ) {
191
+ if ( ! isEncrypted ( req . socket ) && ! options . allowHttp ) {
191
192
return res . redirect ( 301 , `https://${ req . headers . host ! } ${ req . path } ` ) ;
192
193
}
193
194
You can’t perform that action at this time.
0 commit comments