Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit a26f871

Browse files
improve AutoRelay configuration, add config option for static relays
1 parent a1583a3 commit a26f871

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

swarm.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ type SwarmConfig struct {
2222
// EnableAutoRelay enables the "auto relay user" feature.
2323
// Node will find and use advertised public relays when it determines that
2424
// it's not reachable from the public internet.
25+
//
26+
// Deprecated: This flag is deprecated and is overriden by
27+
// `Swarm.AutoRelay.Enabled` if specified.
2528
EnableAutoRelay bool
2629

27-
// RelayService.* controls the "auto relay service" feature.
30+
// AutoRelay controls the "auto relay service" feature.
31+
// When enabled, the node will use relays if it is not publicly reachable.
32+
AutoRelay AutoRelay
33+
34+
// RelayService.* controls the "relay service".
2835
// When enabled, node will provide a limited relay service to other peers.
2936
RelayService RelayService
3037

@@ -35,6 +42,16 @@ type SwarmConfig struct {
3542
ConnMgr ConnMgr
3643
}
3744

45+
type AutoRelay struct {
46+
// Enables the AutoRelay.
47+
Enabled Flag `json:",omitempty"`
48+
49+
// StaticRelays configures static relays to use when this node is not
50+
// publicly reachable. If set, auto relay will not try to find any
51+
// other relay servers.
52+
StaticRelays []string `json:",omitempty"`
53+
}
54+
3855
// RelayService configures the resources of the circuit v2 relay.
3956
// For every field a reasonable default will be defined in go-ipfs.
4057
type RelayService struct {

0 commit comments

Comments
 (0)