Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StopHPClient ¶
Teardown client class
Types ¶
type ClientData ¶
type ClientData struct { RemoteID string `json:"remote_addr"` LocalIP string `json:"local_addr"` LocalPort string `json:"local_port"` LocalID string `json:"local_ID"` }
ClientData contents all data about client to be stored on the server
type ConnectRequest ¶
type ConnectRequest struct { LocalID string `json:"local_id"` RemoteID string `json:"remote_id"` // fif empty, flag to whether client is idle and wants online client listing from server }
ConnectRequest decribes message from client to server, contents requested and local clients ID
type ConnectResponse ¶
type ConnectResponse struct { RemoteIP string `json:"local_addr"` RemotePort string `json:"remote_port"` }
ConnectResponse decribes message from server to client, contents requested client address
type HPClient ¶
type HPClient struct { // Connections and response Conn *net.UDPConn R *ConnectResponse RemoteID string // Client map from HPServer ClientList map[string]ClientData // UI update hook UIupdate *bool ClientUIStage2 *bool UIupdateCListB []byte //todo: Tunnel info & udptunnel command channel TunnelMan *tunnel.TunnelManager // contains filtered or unexported fields }
Define the Hole Punch client struct
func NewHPClient ¶
func NewHPClient(l *zap.Logger, timeout time.Duration, serverAddr, serverPort, localID, remoteID string, UIupdate, ClientUIStage2 *bool, TunnelMan *tunnel.TunnelManager) *HPClient
Initialises a pointer to a new HPClient struct
func (*HPClient) InitiatePunch ¶
Contact info exchange server, perform hole punch and test connection with ping
type HPServer ¶
type HPServer struct { // Client list sync.RWMutex ClientList map[string]ClientData // UI update hook UIupdate *bool ConnLogC chan string // contains filtered or unexported fields }
Define the Hole Punch Server struct
func NewHPServer ¶
Initialises a pointer to a new HPServer struct
Click to show internal directories.
Click to hide internal directories.