mirror of
https://github.com/fatedier/frp.git
synced 2026-01-10 10:13:16 +00:00
udp: fix proxy protocol header sent on every packet instead of first packet only (#5119)
This commit is contained in:
@@ -124,8 +124,8 @@ func Forwarder(dstAddr *net.UDPAddr, readCh <-chan *msg.UDPPacket, sendCh chan<-
|
||||
}
|
||||
mu.Unlock()
|
||||
|
||||
// Add proxy protocol header if configured
|
||||
if proxyProtocolVersion != "" && udpMsg.RemoteAddr != nil {
|
||||
// Add proxy protocol header if configured (only for the first packet of a new connection)
|
||||
if !ok && proxyProtocolVersion != "" && udpMsg.RemoteAddr != nil {
|
||||
ppBuf, err := netpkg.BuildProxyProtocolHeader(udpMsg.RemoteAddr, dstAddr, proxyProtocolVersion)
|
||||
if err == nil {
|
||||
// Prepend proxy protocol header to the UDP payload
|
||||
|
||||
Reference in New Issue
Block a user