2021-11-29 18:40:04 +00:00
|
|
|
# -*- 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.
|
|
|
|
"""
|
2021-11-30 22:48:49 +00:00
|
|
|
import uvicorn
|
2021-11-29 18:40:04 +00:00
|
|
|
from blacksheep.server import Application
|
|
|
|
from blacksheep.server.responses import text
|
|
|
|
|
|
|
|
|
|
|
|
app = Application()
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/http-route-example')
|
|
|
|
async def home(request): # type: ignore[no-untyped-def]
|
|
|
|
return text('HTTP route response')
|
2021-11-30 22:48:49 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
uvicorn.run('server:app', port=9000, workers=10, log_level='warning')
|