mirror of
https://github.com/caddyserver/caddy.git
synced 2026-04-23 17:39:33 -04:00
Add note about capturing h
This commit is contained in:
parent
4ef0e8a9a5
commit
b0dc5d8bb8
@ -193,7 +193,8 @@ func (h *Handler) handleUpgradeResponse(logger *zap.Logger, rw http.ResponseWrit
|
||||
// gracefully close connections we recognize as websockets. We need to make
|
||||
// sure the client connection messages (i.e. to upstream) are masked, so we
|
||||
// need to know whether the connection is considered the server or the
|
||||
// client side of the proxy.
|
||||
// client side of the proxy. Note that gracefulClose must not capture h,
|
||||
// since the tunnel may outlive the handler instance.
|
||||
gracefulClose := func(conn io.ReadWriteCloser, isClient bool) func() error {
|
||||
if isWebsocket(req) {
|
||||
return func() error {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user