fix(client): write proxy protocol header in tls2raw plugin (#5362)

Co-authored-by: futrobo <futrobo@163.com>
This commit is contained in:
kaixings
2026-06-22 23:08:50 +08:00
committed by GitHub
parent 54c6ccdfec
commit 4cc826e236

View File

@@ -72,6 +72,15 @@ func (p *TLS2RawPlugin) Handle(ctx context.Context, connInfo *ConnectionInfo) {
return return
} }
if connInfo.ProxyProtocolHeader != nil {
if _, err := connInfo.ProxyProtocolHeader.WriteTo(rawConn); err != nil {
xl.Warnf("tls2raw write proxy protocol header to local conn error: %v", err)
rawConn.Close()
tlsConn.Close()
return
}
}
libio.Join(tlsConn, rawConn) libio.Join(tlsConn, rawConn)
} }