tun2dialer

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package tun2dialer provides Tun2Dialer to handle Tun.

Index

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

Jump to

Keyboard shortcuts

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