Skip to content

Commit

Permalink
Support IPv6 question and response
Browse files Browse the repository at this point in the history
- Addresses #69
  • Loading branch information
edaniels committed Feb 8, 2024
1 parent dc39736 commit 2b41bfa
Show file tree
Hide file tree
Showing 3 changed files with 558 additions and 145 deletions.
17 changes: 16 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,24 @@ import (
"time"

"github.com/pion/logging"
"golang.org/x/net/ipv6"
)

const (
// DefaultAddress is the default used by mDNS
// and in most cases should be the address that the
// net.Conn passed to Server is bound to
// ipv4.PacketConn passed to Server is bound to
DefaultAddress = "224.0.0.0:5353"

// DefaultAddressIPv4 is the default used by mDNS
// and in most cases should be the address that the
// ipv4.PacketConn passed to Server is bound to
DefaultAddressIPv4 = DefaultAddress

// DefaultAddressIPv6 is the default IPv6 address used
// by mDNS and in most cases should be the address that
// the ipv6.PacketConn passed to Server is bound to
DefaultAddressIPv6 = "[FF02::]:5353"
)

// Config is used to configure a mDNS client or server.
Expand All @@ -38,4 +49,8 @@ type Config struct {

// Interfaces will override the interfaces used for queries and answers.
Interfaces []net.Interface

// MulticastConnV6 is used to receive mDNS questions over IPv6. It can be used in conjunction
// with Server's ipv4.PacketConn or on its own if the Server ipv4 argument is nil.
MulticastConnV6 *ipv6.PacketConn
}
Loading

0 comments on commit 2b41bfa

Please sign in to comment.