We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server code
func main() { cert, err := tls.LoadX509KeyPair("cert/xxxx.crt", "cert/xxx.key") if err != nil { log.Println(err) return } config := &tls.Config{ Certificates: []tls.Certificate{cert}} ln, err := tls.Listen("tcp", ":9090", config) proxyListener := &proxyproto.Listener{ Listener: ln, } conn, err := proxyListener.Accept() if err != nil { log.Fatalf("err: %v", err) } defer conn.Close() addr := conn.RemoteAddr().(*net.TCPAddr) fmt.Println("ip====", addr.IP.String()) if addr.IP.String() != "10.1.1.1" { log.Fatalf("bad: %v", addr) } if addr.Port != 1000 { log.Fatalf("bad: %v", addr) } }
client code
func main() { conn, err := net.Dial("tcp", "127.0.0.1:9090") if err != nil { log.Fatalf("err: %v", err) } defer conn.Close() // Write out the header! header := "PROXY TCP4 10.1.1.1 20.2.2.2 1000 2000\r\n" conn.Write([]byte(header)) }
trigger error
[ERR] Failed to read proxy prefix: tls: first record does not look like a TLS handshake
on golang source code
i think you wrap listener runing after the golang source code tls handshake
The text was updated successfully, but these errors were encountered:
Can you try what is suggested in #89 (comment)?
Sorry, something went wrong.
Closing due to lack of response by issue creator.
No branches or pull requests
server code
client code
trigger error
on golang source code
i think you wrap listener runing after the golang source code tls handshake
The text was updated successfully, but these errors were encountered: