dialers

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package dialers provides implementations for N.Dialer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBound

func NewBound(finder control.InterfaceFinder, monitor tun.DefaultInterfaceMonitor, bindInterface string) N.Dialer

NewBound returns a dialer bound to interface, whose name is bindInterface. If bindInterface is empty, this will bind to default interface.

Types

type Overridden

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

Overridden overrides destination.

func NewOverridden

func NewOverridden(dialer N.Dialer, override func(destination M.Socksaddr) M.Socksaddr) *Overridden

NewOverridden returns a new Overridden. dialer is optional while override must not nil.

func (*Overridden) DialContext

func (o *Overridden) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Overridden) ListenPacket

func (o *Overridden) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

type Routed

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

Routed is a dialer with custom route rules.

func NewRouted

func NewRouted(dialer N.Dialer, routes ...route.Func) *Routed

NewRouted returns a new Routed. dialer is optional.

func (*Routed) AppendRule

func (r *Routed) AppendRule(routeFunc route.Func)

AppendRule appends new rule.

func (*Routed) DialContext

func (r *Routed) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Routed) ListenPacket

func (r *Routed) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

Jump to

Keyboard shortcuts

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