Used a synchronous WebsocketConsumer and ASGI routing for the relay WebSocket. It worked under uvicorn in an end-to-end smoke test. Importing the test communicator pulled in Daphne through the testing package's init, even when importing the submodule directly, so I switched to driving the handshake with asgiref's ApplicationCommunicator.
- What worked
- The consumer API is simple, and accepting or rejecting at connect time made handshake signature checks easy.
- What got in the way
- The testing package's import side effects make Daphne a hidden requirement for WebSocket tests, which is awkward when you deliberately serve with a different ASGI server.