Documentation ¶
Index ¶
- func DialTCP(laddr, raddr *net.TCPAddr) (*net.TCPConn, error)
- func DialTCPWithDevice(device string, laddr, raddr *net.TCPAddr) (*net.TCPConn, error)
- func DialUDP(network string, laddr *net.UDPAddr, raddr *net.UDPAddr) (*net.UDPConn, error)
- func ListenTCP(network string, laddr *net.TCPAddr) (net.Listener, error)
- func ListenTCPWithDevice(device, 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 Conn
- type Listener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialTCP ¶
DialTCP will open a TCP connection to the specified destination with the specified local address.
func DialTCPWithDevice ¶
DialTCPWithDevice will open a TCP connection to the specified destination with the specified local address, and will bind with interface `device`.
func DialUDP ¶
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 ¶
ListenTCP will construct a new TCP listener socket with the Linux IP_TRANSPARENT option set on the underlying socket
func ListenTCPWithDevice ¶
ListenTCPWithDevice construsts a new TCP listener socket with IP_TRANSPARENT option and binds with interface `device`.
func ListenUDP ¶
ListenUDP will construct a new UDP listener socket with the Linux IP_TRANSPARENT option set on the underlying socket
func ReadFromUDP ¶
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 Conn ¶
Conn describes a connection accepted by the TProxy listener.
It is simply a TCP connection with the ability to dial a connection to the original destination while assuming the IP address of the client
func (*Conn) DialOriginalDestination ¶
DialOriginalDestination will open a TCP connection to the original destination that the client was trying to connect to before being intercepted.
When `dontAssumeRemote` is false, the connection will originate from the IP address and port that the client used when making the connection. Otherwise, when true, the connection will originate from an IP address and port assigned by the Linux kernel that is owned by the operating system
func (*Conn) DialOriginalDestinationWithDevice ¶
func (conn *Conn) DialOriginalDestinationWithDevice(device string, dontAssumeRemote bool) (*net.TCPConn, error)
DialOriginalDestinationWithDevice will open a TCP connection to the original destination that the client was trying to connect to before being intercepted.
When `dontAssumeRemote` is false, the connection will originate from the IP address and port that the client used when making the connection. Otherwise, when true, the connection will originate from an IP address and port assigned by the Linux kernel that is owned by the operating system
type Listener ¶
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 ¶
Accept waits for and returns the next connection to the listener.
This command wraps the AcceptTProxy method of the Listener
func (*Listener) AcceptTProxy ¶
AcceptTProxy will accept a TCP connection and wrap it to a TProxy connection to provide TProxy functionality