Ge0rg3/requests-ip-rotator

I want to know what my ip is before sending a request.

awesome1128 opened this issue · 1 comments

Hi there?
Nice to meet you.
Here is a sample code, I copied from this github repo.

from os import access
import time
import requests
from requests_ip_rotator import ApiGateway, DEFAULT_REGIONS

Create gateway object and initialise in AWS

gateway = ApiGateway("https://wordpress.org", regions=["us-east-1", "us-east-2"], access_key_id='xxxxxxxx', access_key_secret='xxxx')
gateway.start()

Assign gateway to session

session = requests.Session()
session.mount("https://wordpress.org", gateway)
print(session)
time.sleep(900)

Send request (IP will be randomised)

response = session.get("https://wordpress.org/support/")
print(response.status_code)

Delete gateways

gateway.shutdown()

So I can see this line(# Send request (IP will be randomised))
It means that the code generates random IPs before sending a request.
If it's correct, how can I know generated IP address?
If anyone knows this, please help me.
Thank you!

Hi @awesome1128, sadly this is not possible via the API Gateway method.
You can verify that your code is working by sending a request to a webhook, for example through https://webhook.site instead of your target as this will allow you to see some example IPs being used.