* Disable mandatory TLS verification with --insecure
* Fix lint issues
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix type issues with `cert_der_to_dict`
* Flake8 exception
* Fix `cert_der_to_dict` where file may not be writter before it is gets used by `_test_decode_cert`
* Silence lint issue due to pylint bug
* Rename flag to `--insecure-tls-interception`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Reuse `DEFAULT_SSL_CONTEXT_OPTIONS`
* # noqa: WPS436
---------
Co-authored-by: d4x <d_4xfe@proton.me>
Co-authored-by: d4xfe <168460626+d4xfe@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Support for Python 3.12
* Use `assert_called_once_with` and not `called_once_with`
* lint fix
* Fix `test_pac_file_served_from_disk`
* [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>
* Remove use of ssl.wrap_socket
ssl.wrap_socket() has been deprecated since Python 3.7, and isn't
recommended for use, and further, has been removed in Python 3.12.
ssl.SSLContext().wrap_socket() is the new path forward, so switch the
one callsite and the two test cases to use it instead.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix `SSLContext.wrap_socket` params and reusable `DEFAULT_SSL_CONTEXT_OPTIONS`
* Fix test cases
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix e2e tests???
---------
Co-authored-by: Steve Kowalik <steven@wedontsleep.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* SSH handler/listener plugins
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Readme updated
* Fix listener tests
* pyclassrole
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Trigger rebuild
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Trigger build
* pre-commit default language version 3.10
* Language version
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Ability to override `--data-dir` for scenarios when `proxy.py` is running as a user with no home directory
* Single quotes
* Update expected tar.gz name and Default to `ms-python.black-formatter` in vscode settings
* Fix tests for Python 3.6 and 3.7
* Updated README
* Changes for Python 3.11 support
* Updated README.md for versioning info
* Update `httpx==0.27.0` to avoid `cgi` deprecation warning from pytest on Python 3.11
* Make tests work for 3.11
* Declare support for 3.11
* Use 3.11-alpine for Docker images
* Preserve pylint version for `python_version <= 3.10`
* Preserve httpx version for <= 3.10
* `httpx` usage fix in tests for <=3.10
* Adjust pylint and pytest for >= 3.11
* Use 3.11.8, bad-option-value and httpx proxies fix
* tox for 3.11
* Fix for `TOXENV: py`
* -vv for pytest
* Downgrade to `pytest-asyncio==0.21.1`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove asyncio_mode=strict
* try with `pytest-cov==4.1.0` for 3.11
* bump coverage for 3.11
* Try `3.11` in GitHub workflow which installs >3.11.8 unavailable via pyenv yet
* Revert back to `-v`
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* test: Add test case to reproduce bug #1267
* fix: Bypass proxy authentication with HTTP/1.0 requests #1267
* [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>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>
* Use www.google.com for http2 tests
* Update README.md
Add missing tutorial's link
(cherry picked from commit e459f932cd)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* System packages for readthedocs
* Pin pyyaml, see https://github.com/yaml/pyyaml/issues/724\#issuecomment-1638587228
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Ignore flake8 S507
* precommit `pyyaml==5.3.1`
* follow https://github.com/yaml/pyyaml/issues/724
* pin to essentials_openapi==0.1.4 for blacksheep
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Remove blacksheep dep
* remove system_packages
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Check if tox upgrade helps with `ERROR: FAIL could not package project ` tox related issues
* Fix links
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Use `importlib.metadata` instead of `pkg_resources`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Just remove link from plugin docstring for now
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* pin `sphinxcontrib-applehelp==1.0.2` which is breaking spellcheck
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Pin `sphinxcontrib-*`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* pin `towncrier` too
* add kwargs as a spelling
* `_get_dist` backward compatible with 3.6
* Use `httpbingo.org` instead of `httpbin.org` in tests making network requests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Use `httpbingo` for reverse proxy plugin too which is tested in workflows
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* `importlib-metadata; python_version <= 3.7`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Integration test changes due to usage of httpbingo instead of httpbin
* `importlib-metadata; python_version <= 3.7` moved to build essentials and bypass reverse proxy integration test result verification for now
* Filter and ignore `DeprecationWarning` to make it work on 3.7
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* with deprecation ignore we dont need `importlib-metadata`
---------
Co-authored-by: Wermeille Bastien <bastien.wermeille@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Support --hostnames
* Support python binaries that are not called "python"
* Update log statement to use self.hostname now
---------
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>
* Support plugins defined as inner classes
* Prefer __qualname__ over __name__ for classes
---------
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>
* Use only a single acceptor in tests to avoid Windows pitfalls
* Revert `timeout=1`, likely single acceptor on Windows during tests on GHA is the escape route
* Add a context manager test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* `IS_WINDOWS` must also be True for cygwin environments. Addresses #1169
* Give an acceptor join timeout of 10 seconds instead of None
* Reduce timeout to just 1 sec
* Install necessary types (requests is translative dep)
* Remove conflicting types
* Give precommit the necessary type
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add plugin tests, responses notebook and enhancements to `build_http_packet`
* Add js code snip for ws example
* Fix tests
* ignore all ipynb from codespell
* ignore all ipynb from codespell
* Fix tests and doc spell
* Remove usage of `tobytes`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix chunk parser
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Lint fixes
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Avoid using `tobytes` where possible
* `send` accepts `Union[memoryview, bytes]` now
* [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>
* Add a response generation jupyter notebook
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Make codespell happy
* precommit codespell exclude
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Start of post encryption tests
* Assertion on post encryption callback
* Add `--cache-requests` flag
* Clean up `on_client_data` API as we no longer have a chain within core http protocol handler
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix flake8 warnings
* Fix `inconsistent-return-statements`
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Pre-release cleanups
* Add listener pool test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add multi listener test
* [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>
* Move default cache directory within `proxy.py` instance data directory
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add `CacheByContentTypePlugin` skeleton and remove unnecessary mixin
* Fix startup issues after removal of mixin
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* .
* Fix broken mock
* doc fix
* doc
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Initial commit
* Parse socks4 packet
* Lint check
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix lint issues
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add handler test skeleton
* [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>
* 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>
* Convert `--port` to list of integers
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Prepare for multiport listener
* Multi listeners, but will fail in theory as no port override is currently performed
* Separate `listener` module
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update flags in readme
* Fix imports in listener test
* Fix flag parsing for `port` and `ports`
* Fix tests
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Move reverse proxy core within core lib
* Fix main test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix doc and lint
* Fix lint
* Top level category for reverse plugin
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Handle `SIGINFO`. Try `kill -s INFO <pid>`.
Also remove dirty hack added in flags to incorporate `--basic-auth`
flag. Add `__pycache__` to ignore list. Disable http proxy
during acceptor benchmark.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* not on windows
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* no cover
* # pylint: disable=E1101
* Curl retry on error and check_output 2 minute timeout
* check output timeout None
* Update `faulthandler_timeout` to 2 minutes
* Disable `test_circular_imports`, `isort` integration now works
* Fix curl flags
* Revert back to older flags
* SIGINFO attribute might not even exist
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>
* Raise `HttpProtocolException` if request line scheme do not match `DEFAULT_ALLOWED_URL_SCHEMES`
* ignore WPS329
* Fix tests
* Pin to 4.3.2
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Test coverage for exception handling
* type ignore
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Enable remote threadless and threaded integration test for windows
* Run only threaded on windows
* Use powershell for execution of integration script on Windows
* Update test_integration.py
* Update test_integration.py
Co-authored-by: sowmyasudhasingh <sowmyasudhasingh@gmail.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>
* Add support in `Url` to parse all types of schemes
* .
* Guard handler against http looking protocol but not web or proxy requests
* Fix condition for web server protocol detection
* doc happy
* Update flags and type check imports only
* 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>
* Add TLS interception integration tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix CI
* unused
* Well 3.9 just worked locally
* Dispatching empty byte to client results in OSError for Python < 3.10
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Uncomment old integration tests
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Pass separate `--ca-cert-dir` flag for parallel TLS interception tests
* Temp disable `test_modify_post_response_integration`
* mock ca cert dir
* Is threaded an issue with TLS interception?
* Disable modify chunk response for python < 3.10
* Disable modify chunk response for python < 3.10
* Add TLS interception integration tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixture to gen certificate once for the `test_integration` module
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Use https endpoints in tls interception tests
* Fix modify post data integration test
* Only start 3 acceptor & 3 workers during integration run
* disable chunk response
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
* Refactor tests into submodules
* isort tests
* Add malicious request headers test
* [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>
* Handle invalid request parsing exception when raised, log the bytes for later inspection
* [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>