abhinavsingh / proxy.py

💫 Ngrok FRP Alternative • ⚡ Fast • 🪶 Lightweight • 0️⃣ Dependency • 🔌 Pluggable • 😈 TLS interception • 🔒 DNS-over-HTTPS • 🔥 Poor Man's VPN • ⏪ Reverse & ⏩ Forward • 👮🏿 "Proxy Server" framework • 🌐 "Web Server" framework • ➵ ➶ ➷ ➠ "PubSub" framework • 👷 "Work" acceptor & executor framework
https://abhinavsingh.com/proxy-py-a-lightweight-single-file-http-proxy-server-in-python/
BSD 3-Clause "New" or "Revised" License
2.91k stars 568 forks source link

Multiple protocols using #1305

Open ComBin opened 1 year ago

ComBin commented 1 year ago

Check FAQs Please check Frequently Asked Questions before opening a feature request.

Is your feature request related to a problem? Please describe. As write in documentation "Capable of serving multiple protocols over the same port", but I configured HTTPS proxy and it works only by HTTPS. If i try connect via HTTP to this HTTPS proxy I reciveing error ERR_CONNECTION_RESET.

Describe the solution you'd like Cant find in documentation how to configure proxy.py to working HTTP and HTTPS simultaneously, even on different ports. I just did not find how to do this or it not implemented?

abhinavsingh commented 1 year ago

@ComBin Thanks for raising this, I'll check if something has gone wrong. Did you enable TLS interception too when trying dual protocol mode? If yes, that can be an issue, but need to double check on it.

ComBin commented 1 year ago

Hello @abhinavsingh! No, i don't use TLS interception cause i don't need decrypt my TLS traffic on proxy, also i use Let's Encrypt cert (cause I don't want to drag CA to clients) and of that's why i don't have CA key and cert. So if expected use multi-protocol feature only in case using TLS interception may be you can take this issue as feature request to implement new feature for run different protocols on different ports. You could modify --port key syntax like this for exmample: --port PROTO:PORT.

abhinavsingh commented 1 year ago

Can you share exact flags used to run proxy, I'll try and reproduce the issue at my end.

Surely we can add your proposed feature flags too, if in-built default doesn't work out.

Thanks

ComBin commented 1 year ago

Yep this is simple. Full command looks like: docker create --name proxy -p 8486:8899 -v /etc/letsencrypt/:/ssl/ --rm abhinavsingh/proxy.py:latest --basic-auth 'user:password' --hostname 0.0.0.0 --cert-file /ssl/live/mydomainname/fullchain.pem --key-file /ssl/live/mydomainname/privkey.pem --log-level CRITICAL If without docker: proxy.py --basic-auth 'user:password' --hostname 0.0.0.0 --cert-file /ssl/live/mydomainname/fullchain.pem --key-file /ssl/live/mydomainname/privkey.pem --log-level CRITICAL

abhinavsingh commented 1 month ago

As write in documentation "Capable of serving multiple protocols over the same port"

For posterity, proxy.py support multiple protocols over same port, but it cannot mix clear text and SSL protocols over the same port.