Skip to content

Commit

Permalink
Merge pull request #2 from peteski22/peteski22/dont-error-listener-on…
Browse files Browse the repository at this point in the history
…-invalid-upstream

improve documentation
  • Loading branch information
Peter Wilson authored Jun 17, 2024
2 parents c583ab5 + d96e12c commit 8c97415
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ var (
// e.g. go build -ldflags -X "github.com/pires/go-proxyproto.DefaultReadHeaderTimeout=1s"
DefaultReadHeaderTimeout = 10 * time.Second

// ErrInvalidUpstream should be returned when an upstream connection address
// is not trusted, and therefore is invalid.
ErrInvalidUpstream = fmt.Errorf("proxyproto: upstream connection address not trusted for PROXY information")
)

Expand Down Expand Up @@ -64,7 +66,7 @@ func ValidateHeader(v Validator) func(*Conn) {
}
}

// Accept waits for and returns the next connection to the listener.
// Accept waits for and returns the next valid connection to the listener.
func (p *Listener) Accept() (net.Conn, error) {
for {
// Get the underlying connection
Expand Down

0 comments on commit 8c97415

Please sign in to comment.