Documentation ¶
Index ¶
- Variables
- type Event
- type EventExternalAddressChanged
- type EventType
- type Monitor
- func (m *Monitor) DetectExternalAddress(ctx context.Context, persistent bool) (string, error)
- func (m *Monitor) Events() <-chan Event
- func (m *Monitor) ExternalAddress() string
- func (m *Monitor) Monitoring(ctx context.Context, wg *sync.WaitGroup)
- func (m *Monitor) SetSTUNServer(stunServer protocol.RelayServer)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoSTUNServer = errors.New("no STUN server found")
)
Functions ¶
This section is empty.
Types ¶
type EventExternalAddressChanged ¶
type EventExternalAddressChanged struct {
ExternalAddress string
}
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor is used to monitoring the link change.
func New ¶
func New(dialer *net.Dialer, stunServer protocol.RelayServer) *Monitor
New returns the monitor instance which is used to detect the external address of the current node.
func (*Monitor) DetectExternalAddress ¶
DetectExternalAddress detect the external address of the current node.
func (*Monitor) ExternalAddress ¶
ExternalAddress returns the external address of current node.
func (*Monitor) SetSTUNServer ¶
func (m *Monitor) SetSTUNServer(stunServer protocol.RelayServer)
SetSTUNServer sets the latest STUN server (the same as the primary relay server).
Click to show internal directories.
Click to hide internal directories.