sing-box/transport/wireguard/endpoint.go
世界 a99c3108a7
Improve read wait interface &
Refactor Authenticator interface to struct &
Update smux &
Update gVisor to 20231204.0 &
Update wireguard-go &
Add GSO support for TUN/WireGuard &
Fix router pre-start &
Fix bind forwarder to interface for systems stack
2023-12-18 22:27:03 +08:00

36 lines
563 B
Go

package wireguard
import (
"net/netip"
"github.com/sagernet/wireguard-go/conn"
)
var _ conn.Endpoint = (*Endpoint)(nil)
type Endpoint netip.AddrPort
func (e Endpoint) ClearSrc() {
}
func (e Endpoint) SrcToString() string {
return ""
}
func (e Endpoint) DstToString() string {
return (netip.AddrPort)(e).String()
}
func (e Endpoint) DstToBytes() []byte {
b, _ := (netip.AddrPort)(e).MarshalBinary()
return b
}
func (e Endpoint) DstIP() netip.Addr {
return (netip.AddrPort)(e).Addr()
}
func (e Endpoint) SrcIP() netip.Addr {
return netip.Addr{}
}