diff options
Diffstat (limited to 'web.go')
-rw-r--r-- | web.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,7 +1,9 @@ package main import ( + "context" "html/template" + "net" "net/http" "strconv" "strings" @@ -21,7 +23,7 @@ const SESSION_NAME = "easybridge_session" var sessionsStore sessions.Store = nil var userKeys = map[string]*[32]byte{} -func StartWeb(errch chan error) *http.Server { +func StartWeb(errch chan error, ctx context.Context) *http.Server { session_key := blake2b.Sum256([]byte(config.SessionKey)) sessionsStore = sessions.NewCookieStore(session_key[:]) @@ -39,6 +41,9 @@ func StartWeb(errch chan error) *http.Server { web_server := &http.Server{ Addr: config.WebBindAddr, Handler: logRequest(r), + BaseContext: func(net.Listener) context.Context { + return ctx + }, } go func() { err := web_server.ListenAndServe() |