From 535fc627c4a7c172669d6465e55402a3ece5adc9 Mon Sep 17 00:00:00 2001 From: Brian Ollenberger Date: Fri, 4 Apr 2025 10:46:29 -0700 Subject: [PATCH 1/2] Increase read buffer size to capture the full possible size of a header. --- protocol.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol.go b/protocol.go index 93cf7c4..5c55bb7 100644 --- a/protocol.go +++ b/protocol.go @@ -153,8 +153,8 @@ func (p *Listener) Addr() net.Addr { func NewConn(conn net.Conn, opts ...func(*Conn)) *Conn { // For v1 the header length is at most 108 bytes. // For v2 the header length is at most 52 bytes plus the length of the TLVs. - // We use 256 bytes to be safe. - const bufSize = 256 + // We use 65535, as it's the maximum length representable by a uint16. + const bufSize = 65535 br := bufio.NewReaderSize(conn, bufSize) pConn := &Conn{ From 1f8e75e429a8ec01a4ab79f310867ba8d399b193 Mon Sep 17 00:00:00 2001 From: Brian Ollenberger Date: Fri, 4 Apr 2025 10:55:00 -0700 Subject: [PATCH 2/2] Change module path for release as bollenberger/go-proxyproto. --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a844df8..6ba07ff 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/pires/go-proxyproto +module github.com/bollenberger/go-proxyproto go 1.24