Documentation ¶
Index ¶
- Constants
- Variables
- func GvisorTCPListener(addr string) (net.Listener, error)
- func GvisorUDPListener(addr string) (net.Listener, error)
- func ICMPForwarder(s *stack.Stack, ctx context.Context) func(stack.TransportEndpointID, *stack.PacketBuffer) bool
- func NewStack(ctx context.Context, tun stack.LinkEndpoint) *stack.Stack
- func ParseProxyInfo(conn net.Conn) (id stack.TransportEndpointID, err error)
- func TCPForwarder(s *stack.Stack, ctx context.Context) func(stack.TransportEndpointID, *stack.PacketBuffer) bool
- func TCPListener(addr string) (net.Listener, error)
- func UDPForwarder(s *stack.Stack, ctx context.Context) func(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
- func WriteProxyInfo(conn net.Conn, id stack.TransportEndpointID) error
- type Chain
- type Client
- type ClientDevice
- type Connector
- type DataElem
- type Device
- type Handler
- type Node
- type Peer
- type Route
- type RouteMap
- type Server
- type TCPUDPacket
- type Transporter
Constants ¶
View Source
const (
MaxSize = 1000
)
Variables ¶
View Source
var ( // RouteMapTCP map[srcIP]net.Conn Globe route table for inner ip RouteMapTCP = &sync.Map{} // TCPPacketChan tcp connects TCPPacketChan = make(chan *datagramPacket, MaxSize) )
View Source
var ( // ErrorEmptyChain is an error that implies the chain is empty. ErrorEmptyChain = errors.New("empty chain") )
View Source
var ErrorInvalidNode = errors.New("invalid node")
Functions ¶
func ICMPForwarder ¶ added in v2.3.1
func ICMPForwarder(s *stack.Stack, ctx context.Context) func(stack.TransportEndpointID, *stack.PacketBuffer) bool
func ParseProxyInfo ¶
func ParseProxyInfo(conn net.Conn) (id stack.TransportEndpointID, err error)
ParseProxyInfo parse proxy info [20]byte
func TCPForwarder ¶
func TCPForwarder(s *stack.Stack, ctx context.Context) func(stack.TransportEndpointID, *stack.PacketBuffer) bool
func UDPForwarder ¶
func UDPForwarder(s *stack.Stack, ctx context.Context) func(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
func WriteProxyInfo ¶
func WriteProxyInfo(conn net.Conn, id stack.TransportEndpointID) error
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func (*Chain) DialContext ¶
type Client ¶
type Client struct { Connector Transporter }
type ClientDevice ¶
type ClientDevice struct {
// contains filtered or unexported fields
}
func (*ClientDevice) SetTunInboundHandler ¶
func (d *ClientDevice) SetTunInboundHandler(handler func(tunInbound <-chan *DataElem, tunOutbound chan<- *DataElem))
func (*ClientDevice) Start ¶
func (d *ClientDevice) Start(ctx context.Context)
type Connector ¶
func UDPOverTCPTunnelConnector ¶
func UDPOverTCPTunnelConnector() Connector
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func (*Device) SetTunInboundHandler ¶
type Handler ¶
func GvisorTCPHandler ¶
func GvisorTCPHandler() Handler
func GvisorUDPHandler ¶
func GvisorUDPHandler() Handler
func TCPHandler ¶
func TCPHandler() Handler
func TunHandler ¶
TunHandler creates a handler for tun tunnel.
type Node ¶
type Node struct { Addr string Protocol string Remote string // remote address, used by tcp/udp port forwarding Values url.Values Client *Client }
type Route ¶
Route example: -L "tcp://:10800" -L "tun://:8422?net=223.254.0.100/16" -L "tun:/10.233.24.133:8422?net=223.254.0.102/16&route=223.254.0.0/16" -L "tun:/127.0.0.1:8422?net=223.254.0.102/16&route=223.254.0.0/16,10.233.0.0/16" -F "tcp://127.0.0.1:10800"
func (*Route) GenerateServers ¶
type RouteMap ¶ added in v2.2.16
type RouteMap struct {
// contains filtered or unexported fields
}
func NewRouteMap ¶ added in v2.2.16
func NewRouteMap() *RouteMap
func (*RouteMap) LoadOrStore ¶ added in v2.2.16
type TCPUDPacket ¶
type TCPUDPacket struct {
// contains filtered or unexported fields
}
type Transporter ¶
func TCPTransporter ¶
func TCPTransporter() Transporter
Click to show internal directories.
Click to hide internal directories.