From 66de03e37c90db09952d0cb47cb120a90afac287 Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Tue, 11 Oct 2016 13:16:02 +0200 Subject: [PATCH] Issue #177: TCP+SNI proxy does not work with PROXY protocol The TCP+SNI proxy fails when used behind a router which uses the HAProxy PROXY protocol since it will not properly decode the ClientHello message from the TLS handshake. Adding the proxyproto listener support to the TCP listener removes fixes this. --- listen.go | 1 + 1 file changed, 1 insertion(+) diff --git a/listen.go b/listen.go index 27e918cf6..33c38b069 100644 --- a/listen.go +++ b/listen.go @@ -52,6 +52,7 @@ func listenAndServeTCP(l config.Listen, h proxy.TCPProxy) { if err != nil { exit.Fatal("[FATAL] ", err) } + ln = &proxyproto.Listener{Listener: tcpKeepAliveListener{ln.(*net.TCPListener)}} defer ln.Close() // close the socket on exit to terminate the accept loop