Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface {
// RemoteAddr returns the destination network address.
RemoteAddr() net.Addr
// LocalAddr returns the local client network address.
LocalAddr() net.Addr
// Receive receives data from TUN.
Receive(data []byte) error
// Write writes data to TUN.
Write(data []byte) error
// Sent will be called when sent data has been acknowledged by clients.
Sent(len uint16)
// Close closes the connection.
Close() error
// Abort aborts the connection to client by sending a RST segment.
Abort()
// Err will be called when a fatal error has occurred on the connection.
Err(err error)
// Reset resets the connection.
Reset()
// LocalDidClose will be called when local client has close the connection.
LocalDidClose()
}
Connection abstracts a TCP/UDP connection comming from TUN. This connection should be handled by a registered TCP/UDP proxy handler.
type ConnectionHandler ¶
type ConnectionHandler interface {
// Connect connects the proxy server.
Connect(conn Connection, target net.Addr) error
// DidReceive will be called when data arrives from TUN.
DidReceive(conn Connection, data []byte) error
// DidSend will be called when sent data has been acknowledged by local clients.
DidSend(conn Connection, len uint16)
// DidClose will be called when the connection has been closed.
DidClose(conn Connection)
// DidAbort will be called when the connection has been aborted.
DidAbort(conn Connection)
// DidReset will be called when the connection has been reseted.
DidReset(conn Connection)
// LocalDidClose will be called when local client has close the connection.
LocalDidClose(conn Connection)
}
ConnectionHandler handles connections comming from TUN.
Click to show internal directories.
Click to hide internal directories.