statute

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 8 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

func Tunnel

func Tunnel(ctx context.Context, c1, c2 io.ReadWriteCloser, buf1, buf2 []byte) error

Tunnel create tunnels for two io.ReadWriteCloser

Types

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{})

type Logger

type Logger interface {
	Debug(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
	Reader      io.Reader
	Writer      io.Writer
	Network     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