Documentation ¶
Index ¶
- func DialMarkedTCP(network string, laddr, raddr *net.TCPAddr, mark int) (net.Conn, error)
- func GetOriginalDestination(conn net.Conn) (net.IP, int, error)
- func MarkConnection(conn net.Conn, mark int) error
- func SocketListener(port string, mark int) (net.Listener, error)
- type ProxiedConnection
- type ProxiedListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialMarkedTCP ¶
DialMarkedTCP creates a new TCP connection and marks it with the provided mark.
func GetOriginalDestination ¶
GetOriginalDestination -- Func to get original destination a connection
func MarkConnection ¶
MarkConnection marks an existing connection with a mark
Types ¶
type ProxiedConnection ¶
ProxiedConnection is a proxied connection where we can recover the original destination.
func (*ProxiedConnection) GetOriginalDestination ¶
func (p *ProxiedConnection) GetOriginalDestination() (net.IP, int)
GetOriginalDestination sets the original destination of the connection.
func (*ProxiedConnection) GetTCPConnection ¶
func (p *ProxiedConnection) GetTCPConnection() *net.TCPConn
GetTCPConnection returns the TCP connection object.
func (*ProxiedConnection) LocalAddr ¶
func (p *ProxiedConnection) LocalAddr() net.Addr
LocalAddr implements the corresponding method of net.Conn, but returns the original address.
type ProxiedListener ¶
type ProxiedListener struct {
// contains filtered or unexported fields
}
ProxiedListener is a proxied listener that uses proxied connections.
func (ProxiedListener) Accept ¶
func (l ProxiedListener) Accept() (c net.Conn, err error)
Accept implements the accept method of the interface.
func (ProxiedListener) Addr ¶
func (l ProxiedListener) Addr() net.Addr
Addr implements the Addr method of net.Listener.
func (ProxiedListener) Close ¶
func (l ProxiedListener) Close() error
Close implements the Close method of the net.Listener.