-
-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*Pool (AcceptorPool, ListenerPool, etc.) to be overridable? #1323
Comments
@alexey-pelykh Interesting :) I don't see bigger issue with such a provision (flag based pool class overrides), unless it doesn't become a burden on the library to keep the contract with external pool handlers. Can you tell me a bit more about why you need a custom pool manager. Also, how different will it be compared to existing pool classes. |
Thus far I have a specific issue with |
Currently, PS: I'll dig back into some of the code and try to pinpoint where changes can be made to enable this capability. |
@alexey-pelykh To achieve listening on multiple interfaces(ip) and port matrix, we simply need to override this line https://github.com/abhinavsingh/proxy.py/blob/develop/proxy/core/listener/tcp.py#L76 This line currently directly uses Let me know what you think of it and iff such a thing will suffice for your use case. |
For a proof-of-concept, if you like, just hardcode your logic on this line to get started https://github.com/abhinavsingh/proxy.py/blob/develop/proxy/core/listener/tcp.py#L76 Instead of |
@abhinavsingh please see #1325 |
@abhinavsingh With that PR almost taken care of I still feel there's a bit of extensibility lacking - e.g. some parts of |
@alexey-pelykh I am just wondering, whether you are trying to use I agree somewhat on the Overall, I don't see an issue adding pool overrides. However, my first approach would be to add the facilities or carve out APIs natively to allow external bigger projects to seamlessly integrate with |
@abhinavsingh in my case it's a relay: a proxy with a per-connection configured upstream proxy. Thus https://github.com/abhinavsingh/proxy.py/blob/develop/proxy/plugin/proxy_pool.py#L72 this specific line being there instead of being lazy-evaluated since the plugin instance is per-connection anyways is an issue for me. Then this line https://github.com/abhinavsingh/proxy.py/blob/develop/proxy/proxy.py#L268 unconditionally hijacks the signals of entire program that I can thankfully workaround by overriding the |
Oh, and rationale behind having custom pools - e.g. I'd prefer to have control over which TcpListeners are created since having "all ports on all addresses" is not good for my case yet it makes perfect sense as evolution of current implementation for the project. |
@abhinavsingh any objections or wishlist items for a PR to make
*Pool
classes overridable via corresponding flags?The text was updated successfully, but these errors were encountered: