func main() {
bind := flag.String("bind", "[::]:80", "Address to bind and listen on")
doTLS := flag.Bool("tls", false, "Enable TLS")
+ noH2 := flag.Bool("no-h2", false, "Disable HTTP/2")
doSetUID := flag.Int("setuid", 0, "Set that UID after binding the socket")
doSetGID := flag.Int("setgid", 0, "Set that GID after binding the socket")
doSetGIDs := flag.String("setgids", "", "Comma-separated GIDs to set")
Handler: godlighty.MainHandler,
ReadHeaderTimeout: RWTimeout,
IdleTimeout: time.Minute,
+ Protocols: &http.Protocols{},
+ }
+ srv.Protocols.SetHTTP1(true)
+ if *noH2 {
+ godlighty.NextProtos = []string{"http/1.1"}
+ } else {
+ godlighty.NextProtos = []string{"h2", "http/1.1"}
+ srv.Protocols.SetHTTP2(true)
+ srv.Protocols.SetUnencryptedHTTP2(true)
}
go func() {
<-shutdown
// Highly-customizable HTTP, HTTP/2, HTTPS server
package godlighty
-const Version = "godlighty/0.9.0"
+const Version = "godlighty/0.10.0"
var BindAddr string
)
var (
- NextProtos = []string{"h2", "http/1.1"}
+ NextProtos []string
HostToECDSACertificate map[string]*tls.Certificate
HostECDSAClientAuth map[string]*x509.CertPool