Documentation
¶
Index ¶
- Constants
- func TCP(s *stack.Stack, nat map[tcpip.Address]tcpip.Address, natLock *sync.Mutex, ...) *tcp.Forwarder
- func UDP(s *stack.Stack, nat map[tcpip.Address]tcpip.Address, natLock *sync.Mutex, ...) *udp.Forwarder
- type CloseWrapper
- type Forwarder
- type ICMPForwarderRequest
- type PortsForwarder
- type ProxyKey
- type UDPProxy
Constants ¶
const ( // UDPConnTrackTimeout is the timeout used for UDP connection tracking UDPConnTrackTimeout = 90 * time.Second // UDPBufSize is the buffer size for the UDP proxy UDPBufSize = 65507 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloseWrapper ¶ added in v0.4.0
type CloseWrapper func() error
func (CloseWrapper) Close ¶ added in v0.4.0
func (w CloseWrapper) Close() error
type Forwarder ¶ added in v0.9.0
type Forwarder struct {
// contains filtered or unexported fields
}
func NewForwarder ¶ added in v0.9.0
func NewForwarder(s *stack.Stack, handler func(*ICMPForwarderRequest)) *Forwarder
NewForwarder allocates and initializes a new forwarder.
func (*Forwarder) HandlePacket ¶ added in v0.9.0
func (f *Forwarder) HandlePacket(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
HandlePacket handles all packets.
This function is expected to be passed as an argument to the stack.SetTransportProtocolHandler function.
type ICMPForwarderRequest ¶ added in v0.9.0
type ICMPForwarderRequest struct {
// contains filtered or unexported fields
}
ICMPForwarderRequest represents a request to forward an ICMP packet.
func NewICMPForwarderRequest ¶ added in v0.9.0
func NewICMPForwarderRequest(s *stack.Stack, id stack.TransportEndpointID, pkt *stack.PacketBuffer) *ICMPForwarderRequest
NewICMPForwarderRequest creates a new ICMP forwarder request.
func (*ICMPForwarderRequest) CreateEndpoint ¶ added in v0.9.0
func (f *ICMPForwarderRequest) CreateEndpoint(s *stack.Stack, wq *waiter.Queue) (tcpip.Endpoint, tcpip.Error)
CreateEndpoint creates a new endpoint for this forwarder request.
func (*ICMPForwarderRequest) ID ¶ added in v0.9.0
func (f *ICMPForwarderRequest) ID() stack.TransportEndpointID
ID returns the 4-tuple (src address, src port, dst address, dst port) that represents the connection request.
func (*ICMPForwarderRequest) Packet ¶ added in v0.9.0
func (f *ICMPForwarderRequest) Packet() *stack.PacketBuffer
Packet returns the packet buffer associated with this forwarder request.
type PortsForwarder ¶
type PortsForwarder struct {
// contains filtered or unexported fields
}
func NewPortsForwarder ¶
func NewPortsForwarder(s *stack.Stack) *PortsForwarder
func (*PortsForwarder) Close ¶ added in v0.9.0
func (f *PortsForwarder) Close() error
func (*PortsForwarder) Expose ¶
func (f *PortsForwarder) Expose(protocol types.TransportProtocol, local, remote string) error
func (*PortsForwarder) Mux ¶
func (f *PortsForwarder) Mux() http.Handler
func (*PortsForwarder) Unexpose ¶
func (f *PortsForwarder) Unexpose(protocol types.TransportProtocol, local string) error
type UDPProxy ¶ added in v0.2.0
type UDPProxy struct {
// contains filtered or unexported fields
}
UDPProxy is proxy for which handles UDP datagrams. It implements the Proxy interface to handle UDP traffic forwarding between the frontend and backend addresses.
func NewUDPProxy ¶ added in v0.2.0
NewUDPProxy creates a new UDPProxy.