Add missing callback on close of hijacked connections

This commit is contained in:
ravilr
2019-05-23 00:40:04 -07:00
committed by Traefiker Bot
parent 7722a41270
commit 8f135fdb0a
2 changed files with 8 additions and 3 deletions

View File

@@ -363,7 +363,12 @@ func (f *httpForwarder) serveWebSocket(w http.ResponseWriter, req *http.Request,
ctx.errHandler.ServeHTTP(w, req, errHijack)
return
}
defer conn.Close()
defer func() {
conn.Close()
if f.websocketConnectionClosedHook != nil {
f.websocketConnectionClosedHook(req, conn)
}
}()
errWrite := resp.Write(conn)
if errWrite != nil {