diff --git a/utils/websocket.py b/utils/websocket.py index 36f64ef3..8ae64d7f 100644 --- a/utils/websocket.py +++ b/utils/websocket.py @@ -8,7 +8,7 @@ Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3) Supports following protocol versions: - http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75 - http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76 - - http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07 + - http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10 You can make a cert/key with openssl using: openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem @@ -49,8 +49,7 @@ else: # Degraded functionality if these imports are missing for mod, sup in [('numpy', 'HyBi protocol'), - ('ctypes', 'HyBi protocol'), ('ssl', 'TLS/SSL/wss'), - ('resource', 'daemonizing')]: + ('ssl', 'TLS/SSL/wss'), ('resource', 'daemonizing')]: try: globals()[mod] = __import__(mod) except ImportError: @@ -298,9 +297,9 @@ Sec-WebSocket-Accept: %s\r f['mask'] = buf[f['hlen']:f['hlen']+4] b = c = '' if f['length'] >= 4: - mask = numpy.frombuffer(buf, dtype=numpy.dtype('= 2.6 and numpy module is required for HyBi-07 or greater") - if ver in ['7', '8', '9']: + # HyBi-07 report version 7 + # HyBi-08 - HyBi-10 report version 8 + if ver in ['7', '8']: self.version = "hybi-0" + ver else: raise self.EClose('Unsupported protocol version %s' % ver)