"python proxy" - Views: 821 · Hits: 821 - Type: Public

import requests

proxies = {
'http': 'socks5://216.144.228.130:15378',
'https': 'socks5://216.144.228.130:15378'
}

def main():
    url = "http://ifconfig.me/ip"

#response = requests.get("http://ifconfig.me/ip")
#print('ip: {}'.format(response.text.strip()))

response = requests.get("http://ifconfig.me/ip", proxies=proxies)
print('tor ip: {}'.format(response.text.strip()))

if __name__ == '__main__':
    main()