I've tried to use some third-party services like ipify.com, but it's pretty easy to get Max retries
exception, because I'm sending a lot of requests.
So I've found a really simple way to get my IP through Google DNS (link). Here's the code:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
print(s.getsockname()[0])
s.close()
Also, I've read a few articles (link 1, link 2, link 3) and in my understanding, it's pretty easy to send HTTP GET
request via proxy with socket
module.
But I can't understand, how can I merge this two techniques and connect to 8.8.8.8 via proxy.
Need your help, thanks in advance.