48 if search.search_query.pageno > 1:
51 if search.search_query.query.lower() ==
"tor-check":
55 resp = get(
"https://check.torproject.org/exit-addresses")
56 node_list = re.findall(reg, resp.text)
60 search.result_container.answers[
"tor"] = {
62 "Could not download the list of Tor exit-nodes from: https://check.torproject.org/exit-addresses"
67 x_forwarded_for = request.headers.getlist(
"X-Forwarded-For")
70 ip_address = x_forwarded_for[0]
72 ip_address = request.remote_addr
74 if ip_address
in node_list:
75 search.result_container.answers[
"tor"] = {
77 "You are using Tor and it looks like you have this external IP address: {ip_address}".
format(
83 search.result_container.answers[
"tor"] = {
85 "You are not using Tor and you have this external IP address: {ip_address}".
format(