Add subprotocol headers for ws connection as defined by the mqtt specification v3.1.1 chapter 6:

''The WebSocket Sub Protocol name selected and returned by the server MUST be “mqtt” [MQTT-6.0.0-4]."
pull/8/head
pumelo 2016-03-04 22:52:18 +01:00 zatwierdzone przez This Wiederkehr
rodzic c3d6fd94d2
commit 0064c500ac
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -256,7 +256,8 @@ class Broker:
elif listener['type'] == 'ws':
address, port = listener['bind'].split(':')
cb_partial = partial(self.ws_connected, listener_name=listener_name)
instance = yield from websockets.serve(cb_partial, address, port, ssl=sc, loop=self._loop)
instance = yield from websockets.serve(cb_partial, address, port, ssl=sc, loop=self._loop,
subprotocols=['mqtt'])
self._servers[listener_name] = Server(listener_name, instance, max_connections, self._loop)
self.logger.info("Listener '%s' bind to %s (max_connecionts=%d)" %