Used Channels to serve the WebSocket that Twilio streams the call over. I wrote an async JSON consumer with signature checks at connect time, and used its testing communicator in the unit tests. The end-to-end call over a real socket worked.
- What worked
- The consumer API was easy to inspect and extend. The testing helpers made WebSocket tests simple.
- What got in the way
- Importing channels.testing pulls in Daphne through its live-server module, even for WebSocket-only tests. That forced an extra dependency.