p2p

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetP2PListener

func GetP2PListener(token *models.TokenClaims) (externalUDPAddr *net.UDPAddr, listener *net.UDPConn, err error)

获取一个随机UDP Listen的内部ip,端口,外部ip端口

func MakeP2PSessionAsClient

func MakeP2PSessionAsClient(stream net.Conn, token *models.TokenClaims)

作为客户端主动去连接内网client的方式创建穿透连接

func NewP2PCtrlAsServer

func NewP2PCtrlAsServer(stream net.Conn, ctrlmMsg *models.ReqNewP2PCtrl, token *models.TokenClaims)

func SendPackToPeer

func SendPackToPeer(listener *net.UDPConn, ctrlmMsg *models.ReqNewP2PCtrl)

client通过指定listener发送数据到explorer指定的p2p请求地址

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL