Documentation
¶
Index ¶
- func NewSOCKS5ServerHandler(log *zerolog.Logger, socksTCPConn Connector, socksUDPConn Connector, ...) server.Handler
- type AddressMapper
- type Connector
- func NewDirectConnector() Connector
- func NewLocalForwardingConnector(directConnector Connector, socksConnector Connector, nat AddressMapper) Connector
- func NewRotationConnector(connectors []Connector) Connector
- func NewSOCKS5Connector(connector Connector, socksAddr *SocksAddr) Connector
- func NewSOCKS5UDPConnector(log *zerolog.Logger, tcpConnector Connector, udpConnector Connector, ...) Connector
- type NetworkStack
- type SocksAddr
- type TimeoutConn
- type Transporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSOCKS5ServerHandler ¶
Types ¶
type AddressMapper ¶
type AddressMapper interface { MapAddress(network, address string) (mappedAddress string, exists bool) AddAddressMapping(network, fromAddress, toAddress string) error }
func NewAddressMapper ¶
func NewAddressMapper() AddressMapper
type Connector ¶
type Connector interface {
DialContext(ctx context.Context, network, address string) (net.Conn, error)
}
Connector is responsible for connecting to the destination address.
func NewDirectConnector ¶
func NewDirectConnector() Connector
func NewLocalForwardingConnector ¶
func NewLocalForwardingConnector(directConnector Connector, socksConnector Connector, nat AddressMapper) Connector
func NewRotationConnector ¶
func NewSOCKS5Connector ¶
type NetworkStack ¶
type NetworkStack struct { *stack.Stack TcpIOTimeout time.Duration UdpIOTimeout time.Duration ConnectTimeout time.Duration // contains filtered or unexported fields }
func NewNetworkStack ¶
func NewNetworkStack(log *zerolog.Logger, fd int, mtu uint32, tunNetworkAddr string, socksTCPConn Connector, socksUDPConn Connector, transporter Transporter) (*NetworkStack, error)
func (*NetworkStack) SetupRouting ¶
func (s *NetworkStack) SetupRouting(nic tcpip.NICID, assignNet string) error
type TimeoutConn ¶
type TimeoutConn struct { net.Conn // specifies max amount of time to wait for Read/Write calls to complete IOTimeout time.Duration }
func NewTimeoutConn ¶
func NewTimeoutConn(conn net.Conn, ioTimeout time.Duration) *TimeoutConn
type Transporter ¶
type Transporter interface {
Transport(rw1, rw2 io.ReadWriter) error
}
func NewTransporter ¶
func NewTransporter(log *zerolog.Logger) Transporter
Click to show internal directories.
Click to hide internal directories.