Add support of proxy protocol

This commit is contained in:
9seconds
2026-02-19 14:22:00 +01:00
parent d0e99dda2b
commit cf3437bb63
9 changed files with 75 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package proxyprotocol
import (
"net"
"github.com/pires/go-proxyproto"
)
type ListenerAdapter struct {
proxyproto.Listener
}
func (l *ListenerAdapter) Accept() (net.Conn, error) {
conn, err := l.Listener.Accept()
if err != nil {
return nil, err
}
return connWrapper{conn.(*proxyproto.Conn)}, nil
}