0

I'm running this script:

import requests

proxyDict = {"http"  : 'http://81.93.73.28:8081'}

r = requests.get('http://ipinfo.io/ip', proxies=proxyDict)
r.status_code
r.headers['content-type']

r.encoding

print(r.text)

I've tried my own proxy server as well as several public servers. It still prints my current ip. What am I doing wrong?

stkvtflw
  • 12,092
  • 26
  • 78
  • 155

1 Answers1

1

Problems seem to be with proxy. I tried the random, free one with that code. Also, your code got a few issues. You are calling attributes without usage - they are no need. Try with that code and proxy, for me, it worked.

proxyDict = {"http"  : 'http://162.14.18.11:80'}

r = requests.get('http://ipinfo.io/ip', proxies=proxyDict, )
print(r.status_code)

print(r.text)
Aleksander Ikleiw
  • 2,549
  • 1
  • 8
  • 26