WebSocket binary mode support for docker

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

No files matched your search

+4 -2
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()