mixed

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Proxy)

func WithBindAddress

func WithBindAddress(binAddress string) Option

func WithBytesPool

func WithBytesPool(bytesPool statute.BytesPool) Option

func WithContext

func WithContext(ctx context.Context) Option

func WithListener

func WithListener(ln net.Listener) Option

func WithLogger

func WithLogger(logger *slog.Logger) Option

func WithUserDialFunc

func WithUserDialFunc(proxyDial statute.ProxyDialFunc) Option

func WithUserForwardAddressFunc

func WithUserForwardAddressFunc(packetForwardAddress statute.PacketForwardAddress) Option

func WithUserHandler

func WithUserHandler(handler userHandler) Option

func WithUserListenPacketFunc

func WithUserListenPacketFunc(proxyListenPacket statute.ProxyListenPacket) Option

func WithUserTCPHandler

func WithUserTCPHandler(handler userHandler) Option

func WithUserUDPHandler

func WithUserUDPHandler(handler userHandler) Option

type Proxy

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

func NewProxy

func NewProxy(options ...Option) *Proxy

func (*Proxy) ListenAndServe

func (p *Proxy) ListenAndServe() error

type SwitchConn

type SwitchConn struct {
	net.Conn
	// contains filtered or unexported fields
}

SwitchConn wraps a net.Conn and a bufio.Reader

func NewSwitchConn

func NewSwitchConn(conn net.Conn) *SwitchConn

NewSwitchConn creates a new SwitchConn

func (*SwitchConn) Read

func (c *SwitchConn) Read(p []byte) (n int, err error)

Read reads data into p, first from the bufio.Reader, then from the net.Conn

Jump to

Keyboard shortcuts

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