Documentation ¶
Index ¶
- Constants
- func DialUDP(network string, laddr *net.UDPAddr, raddr *net.UDPAddr) (*net.UDPConn, error)
- func ListenTCP(network string, laddr *net.TCPAddr) (net.Listener, error)
- func ListenUDP(network string, laddr *net.UDPAddr) (*net.UDPConn, error)
- func ReadFromUDP(conn *net.UDPConn, b []byte) (int, *net.UDPAddr, *net.UDPAddr, error)
- type Config
- type Conn
- type Listener
- type PacketConn
- func (c *PacketConn) Close() error
- func (c *PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (c *PacketConn) ReadWithMetadata(p []byte) (int, *tunnel.Metadata, error)
- func (c *PacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)
- func (c *PacketConn) WriteWithMetadata(p []byte, m *tunnel.Metadata) (int, error)
- type Server
- type Tunnel
Constants ¶
const ( IP6T_SO_ORIGINAL_DST = 80 SO_ORIGINAL_DST = 80 )
const MaxPacketSize = 1024 * 8
const Name = "TPROXY"
Variables ¶
This section is empty.
Functions ¶
func DialUDP ¶ added in v0.7.7
DialUDP connects to the remote address raddr on the network net, which must be "udp", "udp4", or "udp6". If laddr is not nil, it is used as the local address for the connection.
func ListenTCP ¶ added in v0.7.7
ListenTCP will construct a new TCP listener socket with the Linux IP_TRANSPARENT option set on the underlying socket
func ListenUDP ¶ added in v0.7.7
ListenUDP will construct a new UDP listener socket with the Linux IP_TRANSPARENT option set on the underlying socket
func ReadFromUDP ¶ added in v0.7.7
ReadFromUDP reads a UDP packet from c, copying the payload into b. It returns the number of bytes copied into b and the return address that was on the packet.
Out-of-band data is also read in so that the original destination address can be identified and parsed.
Types ¶
type Listener ¶ added in v0.7.7
type Listener struct {
// contains filtered or unexported fields
}
Listener describes a TCP Listener with the Linux IP_TRANSPARENT option defined on the listening socket
func (*Listener) Accept ¶ added in v0.7.7
Accept waits for and returns the next connection to the listener.
This command wraps the AcceptTProxy method of the Listener
type PacketConn ¶
type PacketConn struct { net.PacketConn // contains filtered or unexported fields }
func (*PacketConn) Close ¶ added in v0.7.8
func (c *PacketConn) Close() error
func (*PacketConn) ReadWithMetadata ¶ added in v0.7.8
func (*PacketConn) WriteWithMetadata ¶ added in v0.7.8
type Server ¶
type Server struct {
// contains filtered or unexported fields
}