Skip to content

Commit fb5c929

Browse files
committed
basichost: use autonatv2 to verify reachability
fix slice ownership
1 parent 1f6232d commit fb5c929

12 files changed

Lines changed: 1537 additions & 186 deletions

core/event/reachability.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package event
22

33
import (
44
"github.com/libp2p/go-libp2p/core/network"
5+
ma "github.com/multiformats/go-multiaddr"
56
)
67

78
// EvtLocalReachabilityChanged is an event struct to be emitted when the local's
@@ -11,3 +12,12 @@ import (
1112
type EvtLocalReachabilityChanged struct {
1213
Reachability network.Reachability
1314
}
15+
16+
// EvtHostReachableAddrsChanged is sent when host's reachable or unreachable addresses change
17+
// Reachable and Unreachable both contain only Public IP or DNS addresses
18+
//
19+
// Experimental: This API is unstable. Any changes to this event will be done without a deprecation notice.
20+
type EvtHostReachableAddrsChanged struct {
21+
Reachable []ma.Multiaddr
22+
Unreachable []ma.Multiaddr
23+
}

0 commit comments

Comments
 (0)