Documentation ¶
Index ¶
- Constants
- func CalculateInterfaceName() (tunName string)
- func RelayDnsPacket(ctx context.Context, payload []byte) ([]byte, error)
- type Listener
- type ListenerHandler
- func (h *ListenerHandler) NewConnection(ctx context.Context, conn net.Conn, metadata metadata.Metadata) error
- func (h *ListenerHandler) NewPacketConnection(ctx context.Context, conn network.PacketConn, metadata metadata.Metadata) error
- func (h *ListenerHandler) ShouldHijackDns(targetAddr netip.AddrPort) bool
Constants ¶
View Source
const DefaultDnsReadTimeout = time.Second * 10
View Source
const DefaultDnsRelayTimeout = time.Second * 5
Variables ¶
This section is empty.
Functions ¶
func CalculateInterfaceName ¶
func CalculateInterfaceName() (tunName string)
Types ¶
type Listener ¶
type Listener struct { TunName string // contains filtered or unexported fields }
func New ¶
func New(cfg *config.Tun, tcpIn chan<- constant.ConnContext, udpIn chan<- *inbound.PacketAdapter) (l *Listener, err error)
func (*Listener) FlushDefaultInterface ¶
func (l *Listener) FlushDefaultInterface()
type ListenerHandler ¶
type ListenerHandler struct { sing.ListenerHandler DnsAdds []netip.AddrPort }
func (*ListenerHandler) NewConnection ¶
func (*ListenerHandler) NewPacketConnection ¶
func (h *ListenerHandler) NewPacketConnection(ctx context.Context, conn network.PacketConn, metadata metadata.Metadata) error
func (*ListenerHandler) ShouldHijackDns ¶
func (h *ListenerHandler) ShouldHijackDns(targetAddr netip.AddrPort) bool
Click to show internal directories.
Click to hide internal directories.