-
I am trying to make an aiohttp-server in order to handle CONNECT-requests: from aiohttp import web
async def process_request(request) -> web.Response:
return web.Response()
app = web.Application()
import logging
logging.basicConfig(level=logging.DEBUG)
app.router.add_route('*', '/', process_request)
web.run_app(app, port=10001) Starting server and trying to do some requests:
Server responded with 404 status. Same path but with GET-method:
How I have 200 status code. Server logs:
What I am doing wrong? How to handle CONNECT-requests correctly? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
aiohttp was never meant for making proxies, just regular web apps. I doubt the connect method reaches the HTTP handlers. Perhaps you'd be able to intercept it via middlewares, I don't know. This would read the source code if you want to understand it better. |
Beta Was this translation helpful? Give feedback.
aiohttp was never meant for making proxies, just regular web apps. I doubt the connect method reaches the HTTP handlers.
Perhaps you'd be able to intercept it via middlewares, I don't know. This would read the source code if you want to understand it better.