Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTunnel ¶
RegisterTunnel register a tunnel by tunnel name
Types ¶
type Address ¶
func NewAddressFromHostPort ¶
type AddressType ¶
type AddressType byte
const ( IPv4 AddressType = 1 DomainName AddressType = 3 IPv6 AddressType = 4 )
type ConnDialer ¶
ConnDialer creates TCP connections from the tunnel
type ConnListener ¶
ConnListener accept TCP connections
type Dialer ¶
type Dialer interface { ConnDialer PacketDialer }
Dialer can dial to original server with a tunnel
type Listener ¶
type Listener interface { ConnListener PacketListener }
Listener can accept TCP and UDP streams from a tunnel
type PacketConn ¶
type PacketConn interface { net.PacketConn WriteWithMetadata([]byte, *Metadata) (int, error) ReadWithMetadata([]byte) (int, *Metadata, error) }
PacketConn is the UDP packet stream in the tunnel
type PacketDialer ¶
type PacketDialer interface {
DialPacket(Tunnel) (PacketConn, error)
}
PacketDialer creates UDP packet stream from the tunnel
type PacketListener ¶
type PacketListener interface {
AcceptPacket(Tunnel) (PacketConn, error)
}
PacketListener accept UDP packet stream We don't have any tunnel based on packet streams, so AcceptPacket will always receive a real PacketConn
type Tunnel ¶
type Tunnel interface { Name() string NewClient(context.Context, Client) (Client, error) NewServer(context.Context, Server) (Server, error) }
Tunnel describes a tunnel, allowing creating a tunnel from another tunnel We assume that the lower tunnels know exatly how upper tunnels work, and lower tunnels is transparent for the upper tunnels