add disable-http2 option
This commit is contained in:
parent
91586e727f
commit
202eb1da9c
6
main.go
6
main.go
|
@ -30,6 +30,7 @@ type CLIArgs struct {
|
|||
cert, key, cafile string
|
||||
list_ciphers bool
|
||||
ciphers string
|
||||
disableHTTP2 bool
|
||||
}
|
||||
|
||||
func list_ciphers() {
|
||||
|
@ -50,6 +51,7 @@ func parse_args() CLIArgs {
|
|||
flag.StringVar(&args.cafile, "cafile", "", "CA file to authenticate clients with certificates")
|
||||
flag.BoolVar(&args.list_ciphers, "list-ciphers", false, "list ciphersuites")
|
||||
flag.StringVar(&args.ciphers, "ciphers", "", "colon-separated list of enabled ciphers")
|
||||
flag.BoolVar(&args.disableHTTP2, "disable-http2", false, "disable HTTP2")
|
||||
flag.Parse()
|
||||
return args
|
||||
}
|
||||
|
@ -88,6 +90,10 @@ func run() int {
|
|||
IdleTimeout: 0,
|
||||
}
|
||||
|
||||
if args.disableHTTP2 {
|
||||
server.TLSNextProto = make(map[string]func(*http.Server, *tls.Conn, http.Handler))
|
||||
}
|
||||
|
||||
mainLogger.Info("Starting proxy server...")
|
||||
if args.cert != "" {
|
||||
cfg, err1 := makeServerTLSConfig(args.cert, args.key, args.cafile)
|
||||
|
|
Loading…
Reference in New Issue