Skip to content
Open
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/pires/go-proxyproto
module github.com/bollenberger/go-proxyproto
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems off.


go 1.24

Expand Down
4 changes: 2 additions & 2 deletions protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Owner

@pires pires May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering what kind of headers are you parsing. Can you, please, implement a test w/ one or more examples of headers that go beyond 256 bytes?

br := bufio.NewReaderSize(conn, bufSize)

pConn := &Conn{
Expand Down