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

Support plugins defined as inner classes #1318

Closed alexey-pelykh closed 1 year ago

alexey-pelykh commented 1 year ago

Support referencing the following plugin class by name and by type:

class Outer:
    class MyHttpProxyPlugin(HttpProxyPlugin):
        # ...
alexey-pelykh commented 1 year ago

Hm, I may need some insights on what have failed since:

Unable to find qualified name for module: check.py

tests/test_main.py

is there for me on unmodified develop as well

abhinavsingh commented 1 year ago

Hm, I may need some insights on what have failed since:

Unable to find qualified name for module: check.py

tests/test_main.py

is there for me on unmodified develop as well

Thank you @alexey-pelykh for this PR. These are possibly broken due to updated lint toolkit (in this case flake8 I suppose). At times upstream changes starts to show up as new lint errors in our repo :(. I'll address this in a separate PR and re-run/review this PR sometime morrow. Thanks again.

abhinavsingh commented 1 year ago

@alexey-pelykh I am fixing the lint issues via https://github.com/abhinavsingh/proxy.py/pull/1321 , we should be able to get going on this PR thereafter. Meanwhile, could you add a few lines about capabilities that this PR adds to the Loading Plugins section. This will allow others to also discover this magic :) https://github.com/abhinavsingh/proxy.py#loading-plugins

abhinavsingh commented 1 year ago

@alexey-pelykh All looks good. Thank you again for your PR and included tests 🙏. Merging, we can update doc in a separate PR effort.