generated from nathanwoodburn/python-webserver-template
parent
7f0a13f44b
commit
edbfa66249
@ -149,7 +149,7 @@ document.querySelector('.dnssec-toggle').addEventListener('click', function() {
|
|||||||
} else {
|
} else {
|
||||||
// Display an error message
|
// Display an error message
|
||||||
document.getElementById("ssl-results").innerHTML = `<h2>Error</h2>
|
document.getElementById("ssl-results").innerHTML = `<h2>Error</h2>
|
||||||
<p>${data.message}</p>`;
|
<p style="margin-bottom: 3rem;">${data.message}</p>`;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
10
tools.py
10
tools.py
@ -11,14 +11,14 @@ from dns import resolver
|
|||||||
import requests
|
import requests
|
||||||
import re
|
import re
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from requests_doh import DNSOverHTTPSSession, add_dns_provider
|
import requests_doh
|
||||||
import urllib3
|
import urllib3
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
resolver = dns.resolver.Resolver()
|
resolver = dns.resolver.Resolver()
|
||||||
resolver.nameservers = ["194.50.5.28","194.50.5.27","194.50.5.26"]
|
resolver.nameservers = ["194.50.5.28","194.50.5.27","194.50.5.26"]
|
||||||
resolver.port = 53
|
resolver.port = 53
|
||||||
add_dns_provider("HNSDoH", "https://hnsdoh.com/dns-query")
|
requests_doh.add_dns_provider("HNSDoH", "https://hnsdoh.com/dns-query")
|
||||||
|
|
||||||
# Disable warnings
|
# Disable warnings
|
||||||
urllib3.disable_warnings()
|
urllib3.disable_warnings()
|
||||||
@ -211,7 +211,11 @@ class ProxyError(Exception):
|
|||||||
|
|
||||||
def proxy(url: str) -> requests.Response:
|
def proxy(url: str) -> requests.Response:
|
||||||
try:
|
try:
|
||||||
session = DNSOverHTTPSSession("HNSDoH")
|
session = requests_doh.DNSOverHTTPSSession("HNSDoH")
|
||||||
|
ip = socket.gethostbyname("hnsdoh.com")
|
||||||
|
print(f"Resolved IP: {ip}")
|
||||||
|
ip = requests_doh.resolve_dns("dso.dprofile")
|
||||||
|
print(f"Resolved IP: {ip}")
|
||||||
r = session.get(url,verify=False,timeout=30)
|
r = session.get(url,verify=False,timeout=30)
|
||||||
return r
|
return r
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user