-2

I make requests over TOR to the same website but over different protocols: http://wtfismyip.com/text and https://wtfismyip.com/text

and sometimes get different exit IPs. Can anybody explain why is this so? Maybe some TOR relays does not support HTTPS and because of this the other relay becomes exit-node for https schema?

skavans
  • 374
  • 3
  • 18
  • I try to visit the HTTP site using the Tor browser, but since it includes the HTTPS Everywhere Add-On enabled by default, it redirects to the HTTPS site. Your exit IP address will change over time when using Tor. Are the results you are reporting consistent over some interval (e.g., 5-10 minutes)? – pseudon Apr 26 '17 at 13:40
  • I use the python `requests` module to send requests so I can visit this site under http with no redirection to https-version. The results are consistent during about few minutes: when I make requests to http and https versions the exit IPs are different between them, but the same for the protocol. Example: 1) https: IP 123, 2) https: IP 123, 3) http: IP 456, 4) https: IP 123, 5) http: 456 – skavans Apr 28 '17 at 12:22

1 Answers1

0

It is because something like "TOR keep-alive". It is remember the exit node you access the website from and tries to use it again after exit node change even. All is needed to fix this is to close the connection. Like the following:

resp1 = sess.get('http://wtfismyip.com/text')
ip1 = resp1.text

change_node()
resp1.connection.close()

resp2 = sess.get('http://wtfismyip.com/text')
ip2 = resp2.text

After that the IPs are different.

skavans
  • 374
  • 3
  • 18