statute

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBindAddress = "127.0.0.1:1080"

Variables

This section is empty.

Functions

func DefaultContext

func DefaultContext() context.Context

DefaultContext for context.Context type

Types

type BufferedConn

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

func NewBufferedConn

func NewBufferedConn(c net.Conn) *BufferedConn

func (*BufferedConn) Buffered

func (c *BufferedConn) Buffered() int

func (*BufferedConn) Peek

func (c *BufferedConn) Peek(n int) ([]byte, error)

Peek returns the next n bytes without advancing the reader.

func (*BufferedConn) Read

func (c *BufferedConn) Read(p []byte) (int, error)

func (*BufferedConn) ReadByte

func (c *BufferedConn) ReadByte() (byte, error)

func (*BufferedConn) Reader

func (c *BufferedConn) Reader() *bufio.Reader

Reader returns the internal bufio.Reader.

func (*BufferedConn) UnreadByte

func (c *BufferedConn) UnreadByte() error

type BytesPool

type BytesPool interface {
	Get() []byte
	Put([]byte)
}

BytesPool is an interface for getting and returning temporary bytes for use by io.CopyBuffer.

type DefaultLogger

type DefaultLogger struct{}

func (DefaultLogger) Debug

func (l DefaultLogger) Debug(v ...interface{})

func (DefaultLogger) Error

func (l DefaultLogger) Error(v ...interface{})

func (DefaultLogger) Info

func (l DefaultLogger) Info(v ...interface{})

type Logger

type Logger interface {
	Debug(v ...interface{})
	Info(v ...interface{})
	Error(v ...interface{})
}

type PacketForwardAddress

type PacketForwardAddress func(ctx context.Context, destinationAddr string,
	packet net.PacketConn, conn net.Conn) (net.IP, int, error)

PacketForwardAddress specifies the packet forwarding address

type ProxyDialFunc

type ProxyDialFunc func(ctx context.Context, network string, address string) (net.Conn, error)

ProxyDialFunc is used for socks5, socks4 and http

func DefaultProxyDial

func DefaultProxyDial() ProxyDialFunc

DefaultProxyDial for ProxyDialFunc type

type ProxyListenPacket

type ProxyListenPacket func(ctx context.Context, network string, address string) (net.PacketConn, error)

ProxyListenPacket specifies the optional proxyListenPacket function for establishing the transport connection.

func DefaultProxyListenPacket

func DefaultProxyListenPacket() ProxyListenPacket

DefaultProxyListenPacket for ProxyListenPacket type

type ProxyRequest

type ProxyRequest struct {
	Conn        net.Conn
	RemoteAddr  net.Addr
	LocalAddr   net.Addr
	Network     string
	Type        string
	Destination string
	DestHost    string
	DestPort    int32
}

type UserAssociateHandler

type UserAssociateHandler func(request *ProxyRequest) error

UserAssociateHandler is used for socks5

type UserConnectHandler

type UserConnectHandler func(request *ProxyRequest) error

UserConnectHandler is used for socks5, socks4 and http

Jump to

Keyboard shortcuts

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