diff options
| author | Felix Hanley <felix@userspace.com.au> | 2018-02-16 11:40:39 +0000 |
|---|---|---|
| committer | Felix Hanley <felix@userspace.com.au> | 2018-02-16 11:40:39 +0000 |
| commit | c44fe2b9329586d46184b450a32f8771057f794c (patch) | |
| tree | 8f3cfcded1f8f347d7975f7c0f7328f8e7ad69c2 /dht/options.go | |
| parent | 32a655f042a3752d93c4507b4c128b21bf6aa602 (diff) | |
| download | dhtsearch-c44fe2b9329586d46184b450a32f8771057f794c.tar.gz dhtsearch-c44fe2b9329586d46184b450a32f8771057f794c.tar.bz2 | |
Enable IPv6
Diffstat (limited to 'dht/options.go')
| -rw-r--r-- | dht/options.go | 10 |
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 { |
