Hack Forums
[Python] Route request via TCP over proxy? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Route request via TCP over proxy? (/showthread.php?tid=6195008)



Route request via TCP over proxy? - mutate - Feb 24, 2022

I'm working on a bot that sends HTTP-GET requests. I open a TCP socket to port 80, send the HTTP headers I want, wait for a response from the server, and then close the socket.

I want to use a SOCKS4 proxy to send the requests. There are many codes online to do this, however, I was wondering if there were any libraries anyone recommends to make my life easier?

Thanks.


RE: Route request via TCP over proxy? - mutate - Feb 28, 2022

Bump. Still looking for an answer on this.


RE: Route request via TCP over proxy? - mutate - Mar 7, 2022

Still looking for an answer. Thanks.


RE: Route request via TCP over proxy? - foxegado - Mar 7, 2022

The standard is probably just using the requests module with socks. pip install requests[socks]

If you are doing things asynchronously then you can use aiohttp-socks. pip install aiohttp_socks

Sorry, don't have enough posts to include links.