Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tunnel ¶
type Tunnel struct { Server bool LoadRemoteAddr func() net.Addr // RemoteAddr is the address of the remote endpoint and may be // arbitrarily updated. RemoteAddr atomic.Value // contains filtered or unexported fields }
Tunnel is a pluggable vpn that can use anything that implements net.PacketConn
func NewCustomTunnel ¶
func NewCustomTunnel( serverMode bool, tunDevName string, tunLocalAddr, tunRemoteAddr, netAddr net.Addr, ports []uint16, magic string, beatInterval uint, log udpcommon.Logger, setupSocket func(net.Addr) net.PacketConn, resolver func() (net.Addr, error), updateRemoteAddr func(net.Addr), LoadRemoteAddr func() net.Addr, writeConn func(sock net.PacketConn, raddr net.Addr, b []byte, n int, magic [16]byte) (int, error), ) *Tunnel
NewCustomTunnel will create a tunnel using anything that implements the same functions as net.UDPConn.
func NewTunnel ¶
func NewTunnel(serverMode bool, tunDevName, tunLocalAddr, tunRemoteAddr, netAddr string, ports []uint16, magic string, beatInterval uint, log udpcommon.Logger) *Tunnel
NewTunnel *safely* generates a new Tunnel object using the defaults functions.
Click to show internal directories.
Click to hide internal directories.