Documentation ¶
Index ¶
- Constants
- func AcceptTProxy(l *net.TCPListener) (*net.TCPConn, error)
- func DialOriginalDestination(remote, local *net.TCPAddr) (*net.TCPConn, error)
- func GetREDIRECTOriginalDst(clientConn *net.TCPConn) (rawaddr *net.TCPAddr, err error)
- func IptablesCapture(ctx context.Context, addr string, ug func(nc net.Conn, dest, la *net.TCPAddr)) (*net.TCPListener, error)
- func ListenTProxy(ctx context.Context, network string, laddr *net.TCPAddr) (*net.TCPListener, error)
Constants ¶
const ( SO_ORIGINAL_DST = 80 IP6T_SO_ORIGINAL_DST = 80 )
Variables ¶
This section is empty.
Functions ¶
func AcceptTProxy ¶
func AcceptTProxy(l *net.TCPListener) (*net.TCPConn, error)
AcceptTProxy will accept a TCP connection and wrap it to a TProxy connection to provide TProxy functionality
func DialOriginalDestination ¶
DialOriginalDestination will open a TCP connection to the original destination that the client was trying to connect to before being intercepted.
When local is nil, the connection will originate from local, which can be the IP address and port that the client used when making the connection with TProxy. 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
remoteSocketAddress in TProxy case is the localAddr of the tproxy - original destination. localSocketAddress in TProxy is the local IP - to preserve port
func GetREDIRECTOriginalDst ¶
Should be used only for REDIRECT capture.
func IptablesCapture ¶
func ListenTProxy ¶
func ListenTProxy(ctx context.Context, network string, laddr *net.TCPAddr) (*net.TCPListener, error)
ListenTProxy will construct a new TCP listener socket with the Linux IP_TRANSPARENT option set on the underlying socket
Types ¶
This section is empty.