'How to build a proxy manager
I have a list of external HTTP proxies with each having their own authentication credentials. I want to create my own proxy that listens on multiple ports. When somebody connects to my proxy, I want to forward it to one of the proxies from my list. Each port should have a matching equivalent from the list.
Example:
Proxy list: user1:[email protected]:3001, user2:[email protected]:3002, user3:[email protected]:3003
For this list, I want to host my own proxy 127.0.0.1:2001, 127.0.0.1:2002, 127.0.0.1:2003
When somebody connects to my proxy, the request should be forwarded to the other proxy:
127.0.0.1:2001 => user1:[email protected]:3001
127.0.0.1:2002 => user2:[email protected]:3002
127.0.0.1:2001 => user3:[email protected]:3003
Additionally, I would like to have control over it. If somebody connects to 127.0.0.1:2001 but the proxy user1:[email protected]:3001 has some issues, I would like to hold the connection with the client connecting to 127.0.0.1:2001 to do some extra actions, for example re-try the request to user1:[email protected]:3001 or switch it to a different external proxy and re-try the request. The client connecting to 127.0.0.1:2001 should not see this re-try, the only thing the client should see is the final result.
How can this be achieved? I imagine to know the result of the request, some kind of mitm proxy would be needed.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
