netutils

package
v0.10.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAcceptTimeout = errors.New("i/o timeout")
View Source
var ErrClosedConn = errors.New("use of closed network connection")
View Source
var ErrServerClosed = errors.New("server closed")

Functions

func ConnWithAddr

func ConnWithAddr(conn net.Conn, localAddr, remoteAddr net.Addr) net.Conn

func ConnWithCloser

func ConnWithCloser(conn net.Conn, closer func() error) net.Conn

func Dial

func Dial(ctx context.Context, dialer bridge.Dialer, network, address string) (net.Conn, error)

func IsAcceptTimeoutError

func IsAcceptTimeoutError(err error) bool

IsAcceptTimeoutError reports whether err is an error from use of a accept timeout.

func IsClosedConnError

func IsClosedConnError(err error) bool

IsClosedConnError reports whether err is an error from use of a closed network connection.

func IsServerClosedError

func IsServerClosedError(err error) bool

IsServerClosedError reports whether err is an error from server closed.

func Listen

func Listen(ctx context.Context, listener bridge.ListenConfig, network, address string) (net.Listener, error)

func NewCommandDialContext

func NewCommandDialContext(ctx context.Context, commandDialer bridge.CommandDialer, localAddr, remoteAddr net.Addr, proxy []string) (net.Conn, error)

func NewCommandListener

func NewCommandListener(ctx context.Context, commandDialer bridge.CommandDialer, localAddr net.Addr, remoteAddr net.Addr, proxy []string) (net.Listener, error)

func NewNetAddr

func NewNetAddr(network, address string) net.Addr

Types

type Addr

type Addr string

func (Addr) Network

func (a Addr) Network() string

func (Addr) String

func (a Addr) String() string

type VirtualNetwork

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

func (*VirtualNetwork) Accept

func (l *VirtualNetwork) Accept() (net.Conn, error)

func (*VirtualNetwork) Addr

func (l *VirtualNetwork) Addr() net.Addr

func (*VirtualNetwork) Close

func (l *VirtualNetwork) Close() error

func (*VirtualNetwork) Conn

func (l *VirtualNetwork) Conn(clientAddr net.Addr) (net.Conn, error)

Jump to

Keyboard shortcuts

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