* Update acceptor to accept work from multiple ports
* import order
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix acceptor tests
* Tweak
* fix tests
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* isort `proxy.py` main class
* isort init and main
* isort common
* pre-commit fix
* isort dashboard and testing
* isort plugins
* isort core
* Only sort top level http py files
* isort http exception and websocket
* Remove proxy auth plugin from proxy package exports and force discover `PLUGIN_PROXY_AUTH` flags
* isort parser and web server
* no setattr
* isort all
* Enable pre-commit isort hook
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Turn usual suspects to warnings, not error
* Add `HttpClientConnection` skeleton
* Fix doc build
* Update references in http tests
* Make `work` core agnostic to work object construction by adding an abstract static method to `Work` interface called `create`
* Make mypy happy
* Fix tests broken due to change in how work objects are now constructed
* Doc ko bhi happy karo
* Move all TCP server related flags within `tcp_server.py` and also move the encryption functionality within TCP base server
* Templatize `BaseTcpServerHandler` which now expects a client connection object bound to `TcpClientConnection`. This will allow for custom `HttpClientConnection` object in future to be used by `HttpProtocolHandler`
* Pass necessary flags to allow self-signed certificates
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix https integration tests
* Affected by https://github.com/abhinavsingh/proxy.py/issues/994
* Fix docs
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* work module
* Fix imports
* String based typing for multiprocessing.synchronize
* Fix `test_accepts_client_from_server_socket`
* Move staticmethod outside of threadless pool class
* Fix doc build
* Fix test mock
* mp grouped together
* pylint happy
* import only for type checking
* doc build
* wrong import order
* Add `Descriptors` type
* Add a `DescriptorsHandlerMixin` class used throughout the http framework
* Remove dependency upon `HasFileno` ie `typing_extension` too
* Define `SelectableEvents` type
* Fix doc
* Blank line
* Remove dep on `typing-extensions`
* Discover base plugin class
* await on now async handlers
* Add `protocols` abstract static method to `HttpProtocolHandlerBase` which defines which HTTP specification is followed by the core plugin
* lint
* Fix tests
* Lint fixes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Tie connection pool into Threadless
* Pass upstream conn pool reference to work instances
* Mark upstream conn pool as optional
* spellcheck
* Fix unused import
* Work can also be TcpServerConnection, not just TcpClientConnection. More over, it can be any generic work type
* Add py_class_role and py_obj
* Port internal integration tests into public repo
* Fix proxy py addr
* Use cross-platform compat shasum
* Move changelog out of README into a separate file
* Expose the changelog to Sphinx
* Integrate Towncrier configuration into the repo
* Include the change fragment docs in Sphinx
* Add a config for the Chronographer GitHub App
* Add a change note for PR #823
* Update CHANGELOG.md
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>
* Optimize `find_http_line` which is in critical path
* Update benchmark results
* Keep the loop hot, TCP no delay, cleanup inactive check periodically
* Check for shutdown signal with tick
* Use non-reentrant `NonBlockingQueue` implementation instead of `queue.Queue`
* Fix listener test
* lint and doc
* Asynchronous `handle_event` and `LocalExecutor` thread
* Bail out on first task completion
* mypy
* Add `helper/benchmark.sh` and fix threaded which must now use asyncio (reduced performance of threaded)
* Print open file diff from `benchmark.sh`
* Add `--local-executor` flag, disabled by default for now until tests are updated
* Async `handle_readables` and `handle_writables` for `HttpProtocolHandlerPlugin` interface (doesnt impact proxy/web plugins for now)
* Async `get_events`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Address tests after async changes
* mypy and flake8
* spelldoc
* `check.py` and trailing comma
* Rename to `_assertions.py`
* Add missing `pytest-mock` and `pytest-asyncio` deps
* Add `pytest-mock` to `pylint` deps
* Correct use of `parameterize` and add `PT007` to flake8 ignores
* Fix mypy hints broken for `< Python3.9`
* Remove usage of `asynccontextmanager` which is not available for all Python versions that `proxy.py` supports
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix for pre-python-3.9 versions
* `AsyncTask` apis `set_name` and `get_name` are not available on all supported versions
* Install setuptools via `lib-dep` until we recommend editable install
* Deprecate support for `Python 3.6`
* Use recommendation suggested here https://github.com/abhinavsingh/proxy.py/pull/769\#discussion_r753840929
* Address recommendation here https://github.com/abhinavsingh/proxy.py/pull/769\#discussion_r753841906
* Make `Threadless` agnostic of `multiprocessing.Process`
* Acceptors must dispatch to local executor in non-blocking fashion
* No daemon for executor processes and fix shutdown logic
* Only return fds from `_selected_events` not all events data
* Refactor logic
* Prefix private methods with `_`
* `work_queue` and not `client_queue`
* Turn `Threadless` into an abstract executor. Introduce `RemoteExecutor`
* Make `LocalExecutor` agnostic of `threading.Thread`
* `LocalExecutor` now implements `Threadless`
* `get_events` and `get_descriptors` now must return int and not sock. `Threadless` now avoids repeated register/unregister and instead make use of `selectors.modify`
* Fix `main` tests
* Apply suggestions from code review
Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
* Apply code review recommendations manually
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Revert back `Any` and use `addr or None`
* Address `flake8`
* Update tests to use `fileno`
* Fix doc build
* Fix doc spell, use tear down and not teardown
* Doc updates
* Add back support for `Python 3.6`
* Acceptors dont need loop initialization
* On Python 3.6 `asyncio.new_event_loop()` is necessary
* Make doc happy
* `--threaded` needs a new event loop for 3.7 too
* Always use `asyncio.new_event_loop()` for threaded mode
Added e2e integration tests (subprocess & curl) for all modes.
* Lint fixes
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
* Update `make lib-profile`
* Optimize `utils.find_http_line`
* Pass work to executors within their own multiprocessing lock
* Fix tests
* Add `(_py_class_role, Url)` to fix rtfd :D
* Add `TcpUpstreamConnectionHandler` which can be used as standalone or as mixin
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* `TcpUpstreamConnectionHandler` is now an abstract class
* Fix mypy
* `nitpick_ignore` the `proxy.core.base.tcp_upstream.TcpUpstreamConnectionHandler` class
* Add mypy exception for now
* Fix flake
* Fix docstring
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>