flask-uwsgi-websocket icon indicating copy to clipboard operation
flask-uwsgi-websocket copied to clipboard

Do something before uwsgi starts handshaking

Open jaapz opened this issue 9 years ago • 2 comments

It would be nice if I could do something with the incoming HTTP request, before the actual uwsgi handshake is done (in https://github.com/zeekay/flask-uwsgi-websocket/blob/master/flask_uwsgi_websocket/websocket.py#L57).

This way I can include authentication HTTP headers and re-use the authentication system that I have set up for my REST API in my websocket connections. I would like to be able to do this before the handshake is done, so that I can deny the entire request before anything websocket-y is set up.

jaapz avatar Apr 07 '15 13:04 jaapz

I'm not sure I understand what you'd like to see added. Is there a reason why you can't use middleware to accomplish this?

zeekay avatar Apr 14 '15 12:04 zeekay

I've never written middleware, could you maybe point me to some examples on how that would work?

jaapz avatar May 15 '15 08:05 jaapz