On 08/07/2018 11:19 PM, Alex wrote:
When I do this sort of RPC, I put the method in a X-RPC-Action header
This choice is enforced by the framework used in the project, so I
cannot change that. However, I can adjust the client-side, such that
the HTTP request headers also contain the method name. The problem is
that I didn't see how uwsgi can route based on request headers.

I just tested locally:

./uwsgi --http :8000 --route-run 'log:${HTTP_X_RPC_ACTION}' --route-if 'equal:${HTTP_X_RPC_ACTION};test log:HERE' -M

Then ran:

curl -H "X-RPC-Action: test" http://localhost:8000/


And in the logs I got:

spawned uWSGI http 1 (pid: 25698)
test
HERE


So... you can test _any_ CGI var you expect to be there... any header.

As for routing to a specific worker... no, I'm not aware of how you could do this.

--
Curtis
_______________________________________________
uWSGI mailing list
uWSGI@lists.unbit.it
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to