diff --git a/protocol.go b/protocol.go index bfc24e9..0b2ef33 100644 --- a/protocol.go +++ b/protocol.go @@ -12,7 +12,7 @@ import ( // be read from the wire, if Listener.ReaderHeaderTimeout is not set. // It's kept as a global variable so to make it easier to find and override, // e.g. go build -ldflags -X "github.com/pires/go-proxyproto.DefaultReadHeaderTimeout=1s" -var DefaultReadHeaderTimeout = 200 * time.Millisecond +var DefaultReadHeaderTimeout = 10 * time.Second // Listener is used to wrap an underlying listener, // whose connections may be using the HAProxy Proxy Protocol. diff --git a/protocol_test.go b/protocol_test.go index 4d1d8bb..ddc7f3d 100644 --- a/protocol_test.go +++ b/protocol_test.go @@ -265,6 +265,8 @@ func TestReadHeaderTimeoutIsReset(t *testing.T) { // we expect the actual address and port to be returned, // rather than the ProxyHeader we defined. func TestReadHeaderTimeoutIsEmpty(t *testing.T) { + DefaultReadHeaderTimeout = 200 * time.Millisecond + l, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("err: %v", err)