Adds DoH capabilities
This commit is contained in:
parent
117b8c4dfe
commit
0dc6690281
1 changed files with 6 additions and 5 deletions
11
src/util.js
11
src/util.js
|
|
@ -64,6 +64,7 @@ const parseTxtRecordData = (value) => {
|
|||
*/
|
||||
export async function findTxtRecord(host) {
|
||||
const resolver = new DohResolver('https://doh.hosterra.tech/dns-query');
|
||||
const resolved = await resolver.query( '_.' + host );
|
||||
/*resolver.query( host)
|
||||
.then(response => {
|
||||
response.answers.forEach(ans => {
|
||||
|
|
@ -82,11 +83,11 @@ export async function findTxtRecord(host) {
|
|||
.catch(throw new Error(err));*/
|
||||
|
||||
|
||||
const resolved = await resolver.query( '_.' + host );
|
||||
|
||||
//console.log(resolved);
|
||||
throw new Error(JSON.stringify(resolved));
|
||||
/*if (resolved.response.answers) {
|
||||
for (const head of resolved.response.answers) {
|
||||
//throw new Error(JSON.stringify(resolved));
|
||||
if (resolved.answers) {
|
||||
for (const head of resolved.answers) {
|
||||
const txtData = parseTxtRecordData(head.data);
|
||||
if (!txtData[recordParamDestUrl]) continue;
|
||||
return {
|
||||
|
|
@ -94,7 +95,7 @@ export async function findTxtRecord(host) {
|
|||
httpStatus: txtData[recordParamHttpStatus],
|
||||
};
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/*resolver.query( host)
|
||||
.then(response => {
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue