Some more info to help debug the problem. The error I get in the application is "took too long to shut down and was killed." or precisely:
Application instance <Task pending name='Task-2' coro=<StaticFilesWrapper.__call__() running at /home/sandro/.pyenv/versions/3.8.6/envs/fiverr-traefik/lib/python3.8/site-packages/channels/staticfiles.py:44> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fe3092690d0>()]>> for connection <WebRequest at 0x7fe309b68640 method=GET uri=/adrenalinik/sse/channels/sse-example/ clientproto=HTTP/1.1> took too long to shut down and was killed.
Exception inside application: [Errno -3] Temporary failure in name resolution
Traceback (most recent call last):
File "/home/sandro/.pyenv/versions/3.8.6/envs/fiverr-traefik/lib/python3.8/site-packages/channels/generic/http.py", line 81, in http_request
File "/home/misc/src/hg/thunder/siti/adk/fiverr-traefik/apps/adrenalinik/consumers.py", line 71, in handle
File "/home/sandro/.pyenv/versions/3.8.6/lib/python3.8/asyncio/tasks.py", line 656, in sleep
return await future
I guess "Temporary failure in name resolution" is a good candidate for the culprit, but I'm not able to make good profit of it. Rememnber: when passing via nginx it does work correctly.
I thought there were quite a lot of people using Server-Sent events and the fact that there's a compress option to cope with text/stream-data makes me think it's a well-supported setup.
I'd like at least to understand if others have managed to proxy server-sent events.
BTW: am I correct in thinking that if I don't use compress middleware, there's no compression at all and ideally it should work? ie: I only need the option that excludes compression if I explicitely set compression.