Files
routedns/odohclient_test.go
T
Frank Olbricht 72e4730046 Support for Oblivious DNS client (#118)
* Support for Oblivious DNS client

* Update to the ODoH client (#418)

* fixing context problem

* Updated the ODoH client

* allowing ODoH client to send queries without a proxy

* added missing code to load pre configured ODoH server config key

* added missing support for ODoH servers not on port 443

* Implemented feedback on ODoH client

---------

Co-authored-by: Leonard Walter <50204487+LeonardWalter@users.noreply.github.com>
2024-12-24 09:39:21 +09:00

19 lines
479 B
Go

package rdns
import (
"testing"
"github.com/miekg/dns"
"github.com/stretchr/testify/require"
)
func TestODOHClientSimple(t *testing.T) {
d, err := NewODoHClient("test-odoh", "https://odoh-noads-nl.alekberg.net/proxy", "https://odoh.cloudflare-dns.com/dns-query", "", DoHClientOptions{})
require.NoError(t, err)
q := new(dns.Msg)
q.SetQuestion("cloudflare.com.", dns.TypeA)
r, err := d.Resolve(q, ClientInfo{})
require.NoError(t, err)
require.NotEmpty(t, r.Answer)
}