From 2e577fef49e2458ca3da06b30409df8f4eacb21e Mon Sep 17 00:00:00 2001 From: AdamEr8 Date: Fri, 15 Feb 2019 09:08:06 +0200 Subject: Modified TestProxyPROXYOut to conform with the fixed version of PROXY protocol header format original code sent the header in the format: PROXY according to docs header format should be: PROXY this is according to: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt section 2.1. Human-readable header format (Version 1). --- tcpproxy_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcpproxy_test.go b/tcpproxy_test.go index 5d75cc3..4849c68 100644 --- a/tcpproxy_test.go +++ b/tcpproxy_test.go @@ -320,7 +320,7 @@ func TestProxyPROXYOut(t *testing.T) { t.Fatal(err) } - want := fmt.Sprintf("PROXY TCP4 %s %d %s %d\r\nfoo", toFront.LocalAddr().(*net.TCPAddr).IP, toFront.LocalAddr().(*net.TCPAddr).Port, toFront.RemoteAddr().(*net.TCPAddr).IP, toFront.RemoteAddr().(*net.TCPAddr).Port) + want := fmt.Sprintf("PROXY TCP4 %s %s %d %d\r\nfoo", toFront.LocalAddr().(*net.TCPAddr).IP, toFront.RemoteAddr().(*net.TCPAddr).IP, toFront.LocalAddr().(*net.TCPAddr).Port, toFront.RemoteAddr().(*net.TCPAddr).Port) if string(bs) != want { t.Fatalf("got %q; want %q", bs, want) } -- cgit v1.2.3