MDNS registry fix for users on VPNs (#1759)

* filter out unsolicited responses
* send to local ip in case
* allow ip func to be passed in. add option for sending to 0.0.0.0
This commit is contained in:
Dominic Wong
2020-06-30 11:12:52 +01:00
committed by GitHub
parent 0f5c53b6e4
commit 6532b6208b
4 changed files with 68 additions and 20 deletions

View File

@@ -7,7 +7,7 @@ import (
func TestServer_StartStop(t *testing.T) {
s := makeService(t)
serv, err := NewServer(&Config{Zone: s})
serv, err := NewServer(&Config{Zone: s, LocalhostChecking: true})
if err != nil {
t.Fatalf("err: %v", err)
}
@@ -15,7 +15,7 @@ func TestServer_StartStop(t *testing.T) {
}
func TestServer_Lookup(t *testing.T) {
serv, err := NewServer(&Config{Zone: makeServiceWithServiceName(t, "_foobar._tcp")})
serv, err := NewServer(&Config{Zone: makeServiceWithServiceName(t, "_foobar._tcp"), LocalhostChecking: true})
if err != nil {
t.Fatalf("err: %v", err)
}