-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to reset IP? #5
Comments
I think you have to create a new TorRequest instance every time?
with TorRequest(password='Risk1234') as tr:
response= requests.get('http://ipecho.net/plain')
print ("My Original IP Address:",response.text)
tr.reset_identity() #Reset Tor
response= tr.get('http://ipecho.net/plain')
print ("New Ip Address",response.text)
# with TorRequest(password='Risk1234') as tr:
tr.reset_identity() #Reset Tor
response= tr.get('http://ipecho.net/plain')
print ("New Ip Address",response.text) It gives
with TorRequest(password='Risk1234') as tr:
response= requests.get('http://ipecho.net/plain')
print ("My Original IP Address:",response.text)
tr.reset_identity() #Reset Tor
response= tr.get('http://ipecho.net/plain')
print ("New Ip Address",response.text)
with TorRequest(password='Risk1234') as tr:
tr.reset_identity() #Reset Tor
response= tr.get('http://ipecho.net/plain')
print ("New Ip Address",response.text) It works properly:
with TorRequest(password='Risk1234') as tr:
response= requests.get('http://ipecho.net/plain')
print ("My Original IP Address:",response.text)
# tr.reset_identity() #Reset Tor
response= tr.get('http://ipecho.net/plain')
print ("New Ip Address",response.text)
with TorRequest(password='Risk1234') as tr:
# tr.reset_identity() #Reset Tor
response= tr.get('http://ipecho.net/plain')
print ("New Ip Address",response.text) It doesn't reset:
|
Perhaps It feels like there ought to be a method that would expose this e.g. |
Why IP doesn't change when I request it with this site "https://ipecho.net/extra", which is just a more detailed description of your IP in the same domain? I used the 2nd approach also. |
I am usign the following to reset IP:
|
@erdiaker just add new function to the class to renew our session
and you need to call this function during IP renewal in reser_identity function
|
'tr.reset_identity' does not work. What exactly needs to be configured for it to work?
`from torrequest import TorRequest
with TorRequest(proxy_port=9050, ctrl_port=9051, password=None) as tr:
response = tr.get('http://ipecho.net/plain')
print(response.text) # not your IP address
tr.reset_identity()
response = tr.get('http://ipecho.net/plain')
print(response.text) # another IP address, not yours
input('')`
The text was updated successfully, but these errors were encountered: