Here is my configuration:
Apache (1) -> normal uwsgi app (2) -> websocket uwsgi app (3)
(1) is configured as follows:
ProxyPass /{{prefix}}/static/ !
ProxyPass /{{prefix}}/v3/build/ !
ProxyPass /{{prefix}}/ uwsgi://127.0.0.1:{{admin_uwsgi_port}}/{{prefix}}/
(2) is configured as follows to offload the websocket processing to (3) after authorization:
socket=127.0.0.1:9097
master=true
workers=1
offload-threads=2
collect-header=Content-Type CONTENT_TYPE
collect-header=Subscription SUBSCRIPTION
response-route-if=equal:${CONTENT_TYPE};text/event-stream addvar:SUBSCRIPTION=${SUBSCRIPTION}
response-route-if=equal:${CONTENT_TYPE};text/event-stream disableheaders: response-route-if=equal:${CONTENT_TYPE};text/event-stream uwsgi:/run/websockets-staging/socket,0,0
Finally, (3) is fairly straightforward:
socket=/run/websockets-staging/socket
plugins=python,http,gevent
http-websockets=true
gevent=1000
Thanks to strace, I see that the incoming websocket request gets offload correctly to (3), (3) sends back the websocket handshake which is forwarded to (2) which forwards it to (1).
However, the websocket handshake appears to be lost on the way back to client-side. i.e., (1) never retus any data and the websocket is eventually closed client-side when the handshake fails to arrive.
Hence, my question: what could I have done wrong ?
- - , .
برچسب:
نویسنده: استخدام کار