Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 17:15 UTC
reverseproxy: make error chan bigger when reverse proxying websocket (#7419)
WeidiDeng committed
Jan 6, 2026 at 17:55 UTC
80f2ae92cdb504164bac648501e07e0e7c84770e
1 file changed
+4
-1
modules/caddyhttp/reverseproxy/streaming.go
+4
-1
@@ -214,7 +214,10 @@ func (h *Handler) handleUpgradeResponse(logger *zap.Logger, wg *sync.WaitGroup,
214
timeoutc = timer.C
215
}
216
217
- errc := make(chan error, 1)
217
+ // when a stream timeout is encountered, no error will be read from errc
218
+ // a buffer size of 2 will allow both the read and write goroutines to send the error and exit
219
+ // see: https://github.com/caddyserver/caddy/issues/7418
220
+ errc := make(chan error, 2)
221
wg.Add(2)
222
go spc.copyToBackend(errc)
223
go spc.copyFromBackend(errc)