WebSocket binary mode support for docker

This commit is contained in:
ziajka
2017-07-06 10:13:00 +02:00
parent c6f9ec3758
commit 8e8b8bc5a5
2 changed files with 29 additions and 2 deletions

View File

@ -500,9 +500,11 @@ class DockerVM(BaseNode):
while True:
msg = yield from ws.receive()
if msg.tp == aiohttp.MsgType.text:
if msg.tp == aiohttp.MsgType.TEXT:
out.feed_data(msg.data.encode())
elif msg.tp == aiohttp.MsgType.error:
if msg.tp == aiohttp.MsgType.BINARY:
out.feed_data(msg.data)
elif msg.tp == aiohttp.MsgType.ERROR:
log.critical("Docker WebSocket Error: {}".format(msg.data))
else:
out.feed_eof()