summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdamEr8 <[email protected]>2019-02-15 09:08:06 +0200
committerDave Anderson <[email protected]>2021-08-24 10:40:53 -0700
commit2e577fef49e2458ca3da06b30409df8f4eacb21e (patch)
tree9a64548275facf0d6121cbc23954520866be870b
parent0f9bceda1a83b4a17e52ba327a6fb2561285ee1a (diff)
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).
-rw-r--r--tcpproxy_test.go2
1 files changed, 1 insertions, 1 deletions
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)
}