Change Credentials Without Creating New Proxy Instance?
Closed this issue · 2 comments
Hello, I'd like to be able to change the credentials (username/password) at a somewhat high frequency (once every couple seconds per proxy, across ~100 different proxy instances) without having to create a new proxy instance every time. The remote proxy IP/port will remain the same, just the credentials need to change.
Creating a new proxy instance as this frequency just to change credentials often results in the port exhaustion issues that other issues have described, even if I call StopInternalServer() on the proxy instance before creating a new one. StopInternalServer helps, but some ports do appear to get stuck open and accumulate and it quickly becomes problematic at this frequency.
Is this functionality to change credentials only supported, and if not can it be? I haven't seen an easy way to change the credentials without creating an entirely new proxy instance which has the local port exhaustion problems. I realize changing credentials requires re-authenticating to the remote socks server which is maybe why it's not currently supported.
Reason: some (very popular) proxy servers establish a new route to the URL/destination on their end if you change your credentials - so this is a easy method to rotate the remote route.
I think with the way it works with the internal server, only one instance of HttpToSocks5Proxy should be created and be able to change the socks5 proxy in it (host, port, username, password).
Sorry about never responding to this. I'm archiving this project as support for SOCKS proxies has been added in .NET 6.
Every socks tunnel will need a dedicated connection. If you are running through many proxy and credential combinations, each will need a connection, so it may not scale well.
With the support in .NET 6, you'll at least be using only 1 socket per connection instead of 2.