mirror of
https://github.com/fosrl/olm.git
synced 2026-02-20 11:56:43 +00:00
12
olm/olm.go
12
olm/olm.go
@@ -419,6 +419,7 @@ func StartTunnel(config TunnelConfig) {
|
||||
config.Holepunch && !config.DisableRelay, // Enable relay only if holepunching is enabled and DisableRelay is false
|
||||
middleDev,
|
||||
interfaceIP,
|
||||
sharedBind, // Pass sharedBind for holepunch testing
|
||||
)
|
||||
|
||||
peerManager = peers.NewPeerManager(dev, peerMonitor, dnsProxy, interfaceName, privateKey)
|
||||
@@ -432,9 +433,20 @@ func StartTunnel(config TunnelConfig) {
|
||||
return
|
||||
}
|
||||
|
||||
// Add holepunch monitoring for this endpoint if holepunching is enabled
|
||||
if config.Holepunch {
|
||||
peerMonitor.AddHolepunchEndpoint(site.SiteId, site.Endpoint)
|
||||
}
|
||||
|
||||
logger.Info("Configured peer %s", site.PublicKey)
|
||||
}
|
||||
|
||||
peerMonitor.SetHolepunchStatusCallback(func(siteID int, endpoint string, connected bool, rtt time.Duration) {
|
||||
// This callback is for additional handling if needed
|
||||
// The PeerMonitor already logs status changes
|
||||
logger.Info("+++++++++++++++++++++++++ holepunch monitor callback for site %d, endpoint %s, connected: %v, rtt: %v", siteID, endpoint, connected, rtt)
|
||||
})
|
||||
|
||||
peerMonitor.Start()
|
||||
|
||||
// Set up DNS override to use our DNS proxy
|
||||
|
||||
Reference in New Issue
Block a user