netstack

package
v0.0.0-...-93fed14 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSocks5Port = 1080
)

Variables

This section is empty.

Functions

func IsEnabled

func IsEnabled() bool

IsEnabled todo: move these function to cmd layer

func ListenAddr

func ListenAddr() string

Types

type Dialer

type Dialer interface {
	Dial(ctx context.Context, network, addr string) (net.Conn, error)
}

type NSDialer

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

func NewNSDialer

func NewNSDialer(net *netstack.Net) *NSDialer

func (*NSDialer) Dial

func (d *NSDialer) Dial(ctx context.Context, network, addr string) (net.Conn, error)

type NetStackTun

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

func NewNetStackTun

func NewNetStackTun(listenAddress string, address string, mtu int) *NetStackTun

func (*NetStackTun) Close

func (t *NetStackTun) Close() error

func (*NetStackTun) Create

func (t *NetStackTun) Create() (tun.Device, error)

type Proxy

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

Proxy todo close server

func NewSocks5

func NewSocks5(dialer Dialer) (*Proxy, error)

func (*Proxy) Close

func (s *Proxy) Close() error

func (*Proxy) ListenAndServe

func (s *Proxy) ListenAndServe(addr string) error

Jump to

Keyboard shortcuts

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