mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 23:44:01 +03:00
FILE / ScuroNeko/mtg
internal/proxyprotocol/conn.go
Исходный файл и его история в репозитории.
26 lines
426 B
Go
26 lines
426 B
Go
package proxyprotocol
|
|
|
|
import "github.com/pires/go-proxyproto"
|
|
|
|
type connWrapper struct {
|
|
*proxyproto.Conn
|
|
}
|
|
|
|
func (c connWrapper) CloseRead() error {
|
|
tcpConn, ok := c.TCPConn()
|
|
if !ok {
|
|
panic("we support only tcp connections")
|
|
}
|
|
|
|
return tcpConn.CloseRead()
|
|
}
|
|
|
|
func (c connWrapper) CloseWrite() error {
|
|
tcpConn, ok := c.TCPConn()
|
|
if !ok {
|
|
panic("we support only tcp connections")
|
|
}
|
|
|
|
return tcpConn.CloseWrite()
|
|
}
|