Skip to content

Commit

Permalink
Improved godoc for EnableFullDuplex, copied text from stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Aug 1, 2023
1 parent c1db4fe commit 8bde678
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion modules/caddyhttp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,23 @@ type Server struct {
// HTTP request headers.
MaxHeaderBytes int `json:"max_header_bytes,omitempty"`

// Enable full-duplex communication for HTTP/1.1 requests.
// Enable full-duplex communication for HTTP/1 requests.
// Only has an effect if Caddy was built with Go 1.21 or later.
//
// For HTTP/1 requests, the Go HTTP server by default consumes any
// unread portion of the request body before beginning to write the
// response, preventing handlers from concurrently reading from the
// request and writing the response. Enabling this option disables
// this behavior and permits handlers to continue to read from the
// request while concurrently writing the response.
//
// For HTTP/2 requests, the Go HTTP server always permits concurrent
// reads and responses, so this option has no effect.
//
// Test thoroughly with your HTTP clients, as some older clients may
// not support full-duplex HTTP/1 which can cause them to deadlock.
// See https://github.com/golang/go/issues/57786 for more info.
//
// TODO: This is an EXPERIMENTAL feature. Subject to change or removal.
EnableFullDuplex bool `json:"enable_full_duplex,omitempty"`

Expand Down

0 comments on commit 8bde678

Please sign in to comment.