ch11.1
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"database/sql"
|
||||
"flag"
|
||||
"html/template"
|
||||
@@ -67,10 +68,18 @@ func main() {
|
||||
sessionManager: sessionManager,
|
||||
}
|
||||
|
||||
tlsConfig := &tls.Config{
|
||||
CurvePreferences: []tls.CurveID{tls.X25519, tls.CurveP256}, // TODO: read about CurvePreferences
|
||||
}
|
||||
|
||||
srv := &http.Server{
|
||||
Addr: cfg.addr,
|
||||
ErrorLog: errorLog,
|
||||
Handler: app.routes(),
|
||||
Addr: cfg.addr,
|
||||
ErrorLog: errorLog,
|
||||
Handler: app.routes(),
|
||||
TLSConfig: tlsConfig,
|
||||
IdleTimeout: time.Minute,
|
||||
ReadTimeout: 5 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
}
|
||||
|
||||
infoLog.Printf("Starting server on %s", cfg.addr)
|
||||
|
||||
Reference in New Issue
Block a user