nathole

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 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

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

type Controller

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

func NewController

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

func (*Controller) CloseClient

func (nc *Controller) CloseClient(name string)

func (*Controller) GenNatHoleResponse

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

func (*Controller) GenSid

func (nc *Controller) GenSid() string

func (*Controller) HandleClient

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

func (*Controller) HandleVisitor

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

func (*Controller) ListenClient

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

func (*Controller) Run

func (nc *Controller) Run()

type Session

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

	NotifyCh chan struct{}
}

type SidRequest

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