0

How can I check proxy anonymities in Python?

I've tried searching this up but all I got that really made sense was this answer.

But I don't have the resources to host a "test site" to get the headers of the requests.

I've tried hosting my own site on localhost with Flask but my IP doesn't like being GET requested by random proxy servers.

I had an idea to use HttpBin's API but it ignores the Required Via and X-Forwarder-For request headers.

I could probbably use another API but I don't know about any others.

So, how can I check a http proxy's anonymity in Python?

1 Answers1

0

Ok, After actually reading the article in full I found a solution. Using this website I can get the headers of any request using this program:

import requests
import re

html = requests.get("http://azenv.net/").text
headers = {}

r = re.findall(r"[^\n]+ = [^\n]+", html)

for _ in r:
    _ = _.split(" = ", 1)
    headers[_[0]] = _[1]

print(headers)