Documentation
¶
Overview ¶
Package tun2dialer provides Tun2Dialer to handle Tun.
Index ¶
- Constants
- type Options
- type Tun2Dialer
- func (t *Tun2Dialer) Close() error
- func (t *Tun2Dialer) NewConnectionEx(ctx context.Context, conn net.Conn, source, destination M.Socksaddr, ...)
- func (t *Tun2Dialer) NewPacketConnectionEx(ctx context.Context, conn N.PacketConn, source, destination M.Socksaddr, ...)
- func (t *Tun2Dialer) PrepareConnection(network string, source, destination M.Socksaddr) error
- func (t *Tun2Dialer) Start() error
Constants ¶
View Source
const ( UDPTimeout = 5 * time.Minute MTU = 9000 Stack = "mixed" DNSServer = "8.8.8.8" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { tun.Options Stack string UDPTimeout time.Duration IncludeAllNetworks bool BypassLAN bool }
Options is option for Tun2Dialer
type Tun2Dialer ¶
type Tun2Dialer struct {
// contains filtered or unexported fields
}
Tun2Dialer forwards tun connections to dialer.
func NewTun2Dialer ¶
func NewTun2Dialer(ctx context.Context, ctxLogger logger.ContextLogger, tunOptions Options, interfaceFinder control.InterfaceFinder, dialer N.Dialer, ) (*Tun2Dialer, error)
NewTun2Dialer returns Tun2Dialer which forward to dialer.
func (*Tun2Dialer) Close ¶ added in v0.5.1
func (t *Tun2Dialer) Close() error
func (*Tun2Dialer) NewConnectionEx ¶
func (t *Tun2Dialer) NewConnectionEx(ctx context.Context, conn net.Conn, source, destination M.Socksaddr, onClose N.CloseHandlerFunc)
func (*Tun2Dialer) NewPacketConnectionEx ¶
func (t *Tun2Dialer) NewPacketConnectionEx(ctx context.Context, conn N.PacketConn, source, destination M.Socksaddr, onClose N.CloseHandlerFunc)
func (*Tun2Dialer) PrepareConnection ¶
func (t *Tun2Dialer) PrepareConnection(network string, source, destination M.Socksaddr) error
func (*Tun2Dialer) Start ¶
func (t *Tun2Dialer) Start() error
Click to show internal directories.
Click to hide internal directories.