Skip to content

Commit

Permalink
Initialize aiohttp when client connects directly through websocket (F…
Browse files Browse the repository at this point in the history
…ixes #152)
  • Loading branch information
miguelgrinberg committed Dec 11, 2019
1 parent 6f0d26b commit 9a3d645
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engineio/asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ async def _connect_websocket(self, url, headers, engineio_path):
self.logger.info(
'Attempting WebSocket connection to ' + websocket_url)

if self.http is None or self.http.closed: # pragma: no cover
self.http = aiohttp.ClientSession()

try:
if not self.ssl_verify:
ssl_context = ssl.create_default_context()
Expand Down

0 comments on commit 9a3d645

Please sign in to comment.