nathole

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NatHoleTimeout int64 = 10

Timeout seconds.

Functions

This section is empty.

Types

type ClientCfg added in v0.34.0

type ClientCfg struct {
	Name  string
	Sk    string
	SidCh chan *SidRequest
}

type Controller added in v0.34.0

type Controller struct {
	// contains filtered or unexported fields
}

func NewController added in v0.34.0

func NewController(udpBindAddr string) (nc *Controller, err error)

func (*Controller) CloseClient added in v0.34.0

func (nc *Controller) CloseClient(name string)

func (*Controller) GenNatHoleResponse added in v0.34.0

func (nc *Controller) GenNatHoleResponse(session *Session, errInfo string) []byte

func (*Controller) GenSid added in v0.34.0

func (nc *Controller) GenSid() string

func (*Controller) HandleClient added in v0.34.0

func (nc *Controller) HandleClient(m *msg.NatHoleClient, raddr *net.UDPAddr)

func (*Controller) HandleVisitor added in v0.34.0

func (nc *Controller) HandleVisitor(m *msg.NatHoleVisitor, raddr *net.UDPAddr)

func (*Controller) ListenClient added in v0.34.0

func (nc *Controller) ListenClient(name string, sk string) (sidCh chan *SidRequest)

func (*Controller) Run added in v0.34.0

func (nc *Controller) Run()

type Session added in v0.34.0

type Session struct {
	Sid         string
	VisitorAddr *net.UDPAddr
	ClientAddr  *net.UDPAddr

	NotifyCh chan struct{}
}

type SidRequest added in v0.25.0

type SidRequest struct {
	Sid      string
	NotifyCh chan struct{}
}

Jump to

Keyboard shortcuts

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