wgengine/magicsock: update set of DERP nodes

This commit is contained in:
Brad Fitzpatrick
2020-03-05 07:58:16 -08:00
parent 551964c562
commit 848a2bddf0
2 changed files with 13 additions and 6 deletions

View File

@@ -626,6 +626,9 @@ func (c *Conn) derpWriteChanOfAddr(addr *net.UDPAddr) chan<- derpWriteRequest {
c.derpCancel = make(map[int]context.CancelFunc)
}
host := derpHost(addr.Port)
if host == "" {
return nil
}
dc, err := derphttp.NewClient(c.privateKey, "https://"+host+"/derp", log.Printf)
if err != nil {
c.logf("derphttp.NewClient: port %d, host %q invalid? err: %v", addr.Port, host, err)