aboutsummaryrefslogtreecommitdiff
path: root/dht/options.go
diff options
context:
space:
mode:
Diffstat (limited to 'dht/options.go')
-rw-r--r--dht/options.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/dht/options.go b/dht/options.go
index f870a79..b7ded8a 100644
--- a/dht/options.go
+++ b/dht/options.go
@@ -29,6 +29,16 @@ func SetPort(p int) Option {
}
}
+// SetIPv6 enables IPv6
+func SetIPv6(b bool) Option {
+ return func(n *Node) error {
+ if b {
+ n.family = "udp6"
+ }
+ return nil
+ }
+}
+
// SetUDPTimeout sets the number of seconds to wait for UDP connections
func SetUDPTimeout(s int) Option {
return func(n *Node) error {