rosahaj / tlsproxy

HTTP proxy with per-request uTLS fingerprint mimicry and upstream proxy tunneling. Currently WIP.
MIT License
16 stars 4 forks source link

Support upstream proxy authentication #2

Open atyachin opened 5 months ago

atyachin commented 5 months ago

Hi rosahaj, First, thanks much for making this project!

I tried to test a bit and one thing that's quite needed is the ability to specify a user/pass to the upstream proxy via the x-tlsproxy-upstream header. The reason is that most commercial proxy services take authentication and other parameters via the username. So, a typical upstream proxy request can look like: socks5h://user-myproxyusername-country-us-city-nashville-session-284238249-sessionduration-30:myproxypass@pro.proxyvendor.com:7000

Another (unrelated) thing: it would be great if you could add a reference to the valid clients list. It took me a while to figure out the convention of [client_name]-[client_version] given that other project (like https://github.com/LyleMi/ja3proxy) are taking them as different params.

Thanks again!

PandaWorker commented 5 months ago

@atyachin read this pages

Clients - https://github.com/refraction-networking/utls/blob/d2768e4eaac0c6f6e7b9e53ccec6ce8e907addd9/u_common.go#L151

Versions - https://github.com/refraction-networking/utls/blob/d2768e4eaac0c6f6e7b9e53ccec6ce8e907addd9/u_common.go#L573

rosahaj commented 4 months ago

I tried to test a bit and one thing that's quite needed is the ability to specify a user/pass to the upstream proxy via the x-tlsproxy-upstream header. The reason is that most commercial proxy services take authentication and other parameters via the username. So, a typical upstream proxy request can look like: socks5h://user-myproxyusername-country-us-city-nashville-session-284238249-sessionduration-30:myproxypass@pro.proxyvendor.com:7000

socks5 proxy URLs with authentication should already be supported by the underlying FromURL function (see Go source code). Have you already tried using a socks5 connection string with username and password?

Another (unrelated) thing: it would be great if you could add a reference to the valid clients list. It took me a while to figure out the convention of [client_name]-[client_version] given that other project (like https://github.com/LyleMi/ja3proxy) are taking them as different params.

That's a good point, the README currently isn't clear on this. I'll look into it once I have time.