Skip to content

Commit

Permalink
Convert text websocket messages to binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Booth committed May 13, 2019
1 parent 077f7cf commit b91c7ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aiorpcx/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ async def ws_client(cls, uri, **kwargs):

async def recv_message(self):
message = await self.websocket.recv()
# It might be nice to avoid the redundant conversions
if isinstance(message, str):
message = message.encode()
self.session.data_received(message)
return message

Expand Down

0 comments on commit b91c7ff

Please sign in to comment.