Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,15 @@ shutdown semantics or TCP CONNECT handling, and is not included in v1.0.1.
Cancellation requires context-aware resolvers/dialers; custom implementations
that ignore cancellation cannot be forcibly interrupted by the proxy.

Source builds also cancel an HTTP connection's request contexts when that
tracked connection is closed. This lets forced shutdown cancel a pending
upstream request even when HTTP/1.1 pipelining has stopped the background
reader from noticing socket closure. Graceful shutdown still allows active
requests and CONNECT tunnels to finish until its deadline. Expiry returns the
shutdown context error and initiates request cancellation and socket cleanup;
it does not wait indefinitely for custom handlers that ignore cancellation.
This change is not included in v1.0.1.

For SOCKS5 TCP and HTTP CONNECT tunnels, `--idle-timeout` (default `5m`)
measures inactivity across both directions: an active download or upload does
not need reverse-direction application traffic to stay open. A blocked write
Expand Down
2 changes: 1 addition & 1 deletion internal/proxy/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewHTTPServer(cfg Config) (*HTTPServer, error) {
MaxHeaderBytes: 64 << 10,
ConnContext: func(ctx context.Context, conn net.Conn) context.Context {
if tracked, ok := conn.(*trackedConn); ok {
return context.WithValue(ctx, httpConnContextKey{}, tracked)
return context.WithValue(tracked.connectionContext(ctx), httpConnContextKey{}, tracked)
}
return ctx
},
Expand Down
Loading
Loading