Merge pull request #21 from pumelo/master

Add subprotocol headers for ws connection as defined by the mqtt spec…
This was ok on the client, but it has been forgotten in the borker implementation
pull/8/head
Nicolas 2016-03-06 21:33:31 +01:00
commit cbdc0e21b4
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)" %