Documentation ¶
Index ¶
- func DialMarkedWithContext(ctx context.Context, network string, addr string, platformData *PlatformData, ...) (net.Conn, error)
- func GetInterfaces() map[string]struct{}
- func NewSocketListener(ctx context.Context, port string, mark int) (net.Listener, error)
- type Control
- type PlatformData
- type PlatformDataControl
- type ProxiedConnection
- func (p *ProxiedConnection) Close() error
- func (p *ProxiedConnection) GetOriginalDestination() (net.IP, int)
- func (p *ProxiedConnection) GetPlatformData() *PlatformData
- func (p *ProxiedConnection) GetTCPConnection() *net.TCPConn
- func (p *ProxiedConnection) LocalAddr() net.Addr
- func (p *ProxiedConnection) Read(b []byte) (n int, err error)
- func (p *ProxiedConnection) RemoteAddr() net.Addr
- func (p *ProxiedConnection) SetDeadline(t time.Time) error
- func (p *ProxiedConnection) SetReadDeadline(t time.Time) error
- func (p *ProxiedConnection) SetWriteDeadline(t time.Time) error
- func (p *ProxiedConnection) Write(b []byte) (n int, err error)
- type ProxiedListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialMarkedWithContext ¶
func DialMarkedWithContext(ctx context.Context, network string, addr string, platformData *PlatformData, mark int) (net.Conn, error)
DialMarkedWithContext will dial a TCP connection to the provide address and mark the socket with the provided mark.
func GetInterfaces ¶
func GetInterfaces() map[string]struct{}
GetInterfaces retrieves all the local interfaces.
Types ¶
type Control ¶
Control represents the dial control used to manipulate the raw connection.
func ControlFunc ¶
func ControlFunc(mark int, block bool, platformData *PlatformData) Control
ControlFunc used in the dialer.
type PlatformData ¶
type PlatformData struct {
// contains filtered or unexported fields
}
PlatformData is proxy/socket data (platform-specific)
func RemovePlatformData ¶
func RemovePlatformData(l net.Listener, conn net.Conn) *PlatformData
RemovePlatformData removes the data from storage and returns it
func TakePlatformData ¶
TakePlatformData removes the data from storage and returns it
type PlatformDataControl ¶
type PlatformDataControl struct { }
PlatformDataControl dummy impl PlatformDataControl is only needed for Windows now, and allows retrieval of kernel socket data.
func NewPlatformDataControl ¶
func NewPlatformDataControl() *PlatformDataControl
NewPlatformDataControl returns initialized PlatformDataControl
func (*PlatformDataControl) StorePlatformData ¶
func (n *PlatformDataControl) StorePlatformData(ip net.IP, port int, platformData *PlatformData)
StorePlatformData saves the data after GetDestInfo is called.
type ProxiedConnection ¶
type ProxiedConnection struct {
// contains filtered or unexported fields
}
ProxiedConnection is a proxied connection where we can recover the original destination.
func (*ProxiedConnection) Close ¶
func (p *ProxiedConnection) Close() error
Close closes the connection.
func (*ProxiedConnection) GetOriginalDestination ¶
func (p *ProxiedConnection) GetOriginalDestination() (net.IP, int)
GetOriginalDestination sets the original destination of the connection.
func (*ProxiedConnection) GetPlatformData ¶
func (p *ProxiedConnection) GetPlatformData() *PlatformData
GetPlatformData gets the platform-specific socket data (needed for Windows)
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.
func (*ProxiedConnection) Read ¶
func (p *ProxiedConnection) Read(b []byte) (n int, err error)
Read reads data from the connection.
func (*ProxiedConnection) RemoteAddr ¶
func (p *ProxiedConnection) RemoteAddr() net.Addr
RemoteAddr returns the remote address
func (*ProxiedConnection) SetDeadline ¶
func (p *ProxiedConnection) SetDeadline(t time.Time) error
SetDeadline passes the read deadline to the original TCP connection.
func (*ProxiedConnection) SetReadDeadline ¶
func (p *ProxiedConnection) SetReadDeadline(t time.Time) error
SetReadDeadline implements the call by passing it to the original connection.
func (*ProxiedConnection) SetWriteDeadline ¶
func (p *ProxiedConnection) SetWriteDeadline(t time.Time) error
SetWriteDeadline implements the call by passing it to the original connection.
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.