Skip to content

Commit 2e577fe

Browse files
AdamEr8danderson
authored andcommitted
Modified TestProxyPROXYOut to conform with the fixed version of PROXY protocol header format
original code sent the header in the format: PROXY <family> <srcIP> <srcPort> <dstIP> <dstPort> according to docs header format should be: PROXY <family> <srcIP> <dstIP> <srcPort> <dstPort> this is according to: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt section 2.1. Human-readable header format (Version 1).
1 parent 0f9bced commit 2e577fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tcpproxy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ func TestProxyPROXYOut(t *testing.T) {
320320
t.Fatal(err)
321321
}
322322

323-
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)
323+
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)
324324
if string(bs) != want {
325325
t.Fatalf("got %q; want %q", bs, want)
326326
}

0 commit comments

Comments
 (0)