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
3.06k stars 578 forks source link

Document custom auth plugins #1156

Open nettnikl opened 2 years ago

nettnikl commented 2 years ago

Is your feature request related to a problem? Please describe. I'm trying to setup an authentication to happen before any request is processed. I think subclassing proxy.http.proxy.auth.AuthPlugin and loading it using --auth-plugin is the way to go here (loading it works actually, it just seems to never get called). However i cannot even seem to get the basic auth (using the --basic-auth flag) to work for the reverse proxy.

Describe the solution you'd like Some rudimentary documentation about how to implement - and activate! - my own auth plugin for a reverse proxy.

Describe alternatives you've considered Add an example or tutorial

Additional context Somewhat related: https://github.com/abhinavsingh/proxy.py/issues/1091 https://github.com/abhinavsingh/proxy.py/pull/734/commits/8029afbd26951a040c876375c59f384c7079c0df

abhinavsingh commented 2 years ago

Thank you @nettnikl for bringing this to attention. I'll try add some clarity by updating docs and examples. Best

abhinavsingh commented 2 years ago

However i cannot even seem to get the basic auth (using the --basic-auth flag) to work for the reverse proxy.

Revisiting this today. jFYI, reverse proxy doesn't support any sort of auth yet. Good point. I have created https://github.com/abhinavsingh/proxy.py/issues/1258 to track it separately

I'll close this down after adding documentation for auth plugin setup. Now that I read your ticket again, I understand you are probably looking for auth within reverse proxy, which is officially not implemented yet.