sing_tun

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDnsReadTimeout = time.Second * 10
View Source
const DefaultDnsRelayTimeout = time.Second * 5

Variables

View Source
var InterfaceName = "Meta"

Functions

func CalculateInterfaceName

func CalculateInterfaceName(name string) (tunName string)

func RelayDnsPacket

func RelayDnsPacket(ctx context.Context, payload []byte) ([]byte, error)

Types

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

func New

func New(options LC.Tun, tunnel C.Tunnel, additions ...inbound.Addition) (l *Listener, err error)

func (*Listener) Address

func (l *Listener) Address() string

func (*Listener) Close

func (l *Listener) Close() error

func (*Listener) Config

func (l *Listener) Config() LC.Tun

func (*Listener) FlushDefaultInterface

func (l *Listener) FlushDefaultInterface()

type ListenerHandler

type ListenerHandler struct {
	sing.ListenerHandler
	DnsAdds []netip.AddrPort
}

func (*ListenerHandler) NewConnection

func (h *ListenerHandler) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error

func (*ListenerHandler) NewPacketConnection

func (h *ListenerHandler) NewPacketConnection(ctx context.Context, conn network.PacketConn, metadata M.Metadata) error

func (*ListenerHandler) ShouldHijackDns

func (h *ListenerHandler) ShouldHijackDns(targetAddr netip.AddrPort) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL