This commit is contained in:
qaq
2025-06-17 12:17:33 +08:00
parent 4a6b2c8e0f
commit 9fa968d07c
648 changed files with 64968 additions and 1621 deletions
+17
View File
@@ -0,0 +1,17 @@
package proxyproto
import (
"net"
proxyproto "github.com/pires/go-proxyproto"
)
func WrapClientConn(ppv int, src, dst net.Addr, c net.Conn) net.Conn {
if ppv <= 0 {
return c
}
header := proxyproto.HeaderProxyFromAddrs(byte(ppv), src, dst)
header.WriteTo(c)
return c
}