proxy.py/benchmark/_blacksheep.py

28 lines
730 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE for more details.
"""
import uvicorn
Update project test dependencies to ensure green workflow (#1371) * Use www.google.com for http2 tests * Update README.md Add missing tutorial's link (cherry picked from commit e459f932cdb54c37ac6343470eed8581396b642b) * [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>
2024-04-11 07:34:10 +00:00
# from blacksheep.server import Application
# from blacksheep.server.responses import text
Update project test dependencies to ensure green workflow (#1371) * Use www.google.com for http2 tests * Update README.md Add missing tutorial's link (cherry picked from commit e459f932cdb54c37ac6343470eed8581396b642b) * [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>
2024-04-11 07:34:10 +00:00
# app = Application()
# @app.route('/http-route-example')
async def home(request): # type: ignore[no-untyped-def]
Update project test dependencies to ensure green workflow (#1371) * Use www.google.com for http2 tests * Update README.md Add missing tutorial's link (cherry picked from commit e459f932cdb54c37ac6343470eed8581396b642b) * [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>
2024-04-11 07:34:10 +00:00
# return text('HTTP route response')
pass
if __name__ == '__main__':
uvicorn.run('server:app', port=9000, workers=10, log_level='warning')