Help us shape the future of Go! Take the 2026 Go Developer Survey

netstack

package
v0.65.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSocks5Port = 1080
)
View Source
const EnvSkipProxy = "NB_NETSTACK_SKIP_PROXY"
View Source
const EnvUseNetstackMode = "NB_USE_NETSTACK_MODE"

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 netip.Addr, dnsAddress netip.Addr, mtu int) *NetStackTun

func (*NetStackTun) Close

func (t *NetStackTun) Close() error

func (*NetStackTun) Create

func (t *NetStackTun) Create() (tun.Device, *netstack.Net, 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