> Hi, > > I am looking for a way to filter requests in master process, > or anywhere elese *before* the request is dispatched to any > worker. > > One application for this - throttling of request rate based > ony various criterias (controlled by request handlers), > to avoid consuming workers when request must be delayed/rejected. > > Something like uwsgi::preprocess(\&filter) where filter() > receives regular PSGI environment and has a chance to either > pass a request to worker (probably modified) or respond on its own. > > Is there anything in uwsgi that could be used for this purpose? > > -- > Best regards, > Alexander. > >
i think your best bet is placing another uWSGi instance in front of your app. The frontmost instance can use offloaded proxy and routing rules to filter requests: http://uwsgi-docs.readthedocs.io/en/latest/OffloadSubsystem.html http://uwsgi-docs.readthedocs.io/en/latest/articles/OffloadingWebsocketsAndSSE.html http://uwsgi-docs.readthedocs.io/en/latest/Snippets.html#authenticated-websocket-proxy -- Roberto De Ioris http://unbit.com _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
