1
0
Fork 0

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 8a5db8a3ee
commit 63c3ed3931
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 {