azure-sdk-for-python
azure-sdk-for-python copied to clipboard
Websocket async implementation must use pure async lib when available
Currently, we use websocket-client library which does not have a pure async implementation
websockets has one, but it does not support http proxy https://github.com/aaugustin/websockets/issues/364
When possible use a pure async library
aiohttp.ClientSession.ws_connect with aiohttp.ClientWebSocketResponse works quite well.
It has support for async, proxy, ssl settings, etc.
Thanks for this input @hansmbakker! FYI @l0lawrence, @kashifkhan, @swathipil - we should look at this soon as we will need an async story for EH before GA.
Thank you very much @hansmbakker for sharing about the websocket client in aiohttp , this worked out perfectly for us :)