mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 01:14:03 +03:00
FILE / ScuroNeko/mtg
internal/proxyprotocol/adapter.go
Исходный файл и его история в репозитории.
21 lines
311 B
Go
21 lines
311 B
Go
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
|
|
}
|