Make client work with websocket proxy

After switching to websocket proxy, client needs to handle
sub-protocol. See below for details:

https://github.com/websocket-client/websocket-client/issues/140

Depends-On: Ib905d4852b9b5f6398316651da5224232b003dbc
Change-Id: I8b7453e4903c6c5f3abb9886f7bc1797982af48a
This commit is contained in:
Hongbin Lu
2017-05-14 23:22:38 +00:00
parent a933465d06
commit 1f2d5face8

View File

@@ -236,9 +236,9 @@ class WebSocketClient(BaseClient):
url = self.url
LOG.debug('connecting to: %s', url)
try:
self.ws = websocket.create_connection(url,
skip_utf8_validation=True
)
self.ws = websocket.create_connection(
url, skip_utf8_validation=True,
subprotocols=["binary", "base64"])
print('connected to %s ,press Enter to continue' % self.id)
print('type %s. to disconnect' % self.escape)
except socket.error as e: