Adds DoH capabilities

This commit is contained in:
Pierre Lannoy 2023-12-13 19:06:25 +01:00
commit bb40fc56f5
Signed by: Pierre Lannoy
GPG key ID: D27231EF87D53F31

View file

@ -64,7 +64,7 @@ const parseTxtRecordData = (value) => {
*/ */
export async function findTxtRecord(host) { export async function findTxtRecord(host) {
const resolver = new DohResolver('https://doh.hosterra.tech/dns-query'); const resolver = new DohResolver('https://doh.hosterra.tech/dns-query');
resolver.query( host) /*resolver.query( host)
.then(response => { .then(response => {
response.answers.forEach(ans => { response.answers.forEach(ans => {
throw new Error(ans) throw new Error(ans)
@ -79,12 +79,12 @@ export async function findTxtRecord(host) {
}); });
}) })
.catch(throw new Error(err)); .catch(throw new Error(err));*/
//const resolved = await resolver.query( host ); const resolved = await resolver.query( host );
//console.log(resolved); //console.log(resolved);
//throw new Error(resolved.response); throw new Error(JSON.stringify(resolved.response));
/*if (resolved.response.answers) { /*if (resolved.response.answers) {
for (const head of resolved.response.answers) { for (const head of resolved.response.answers) {
const txtData = parseTxtRecordData(head.data); const txtData = parseTxtRecordData(head.data);