Lawouach / WebSocket-for-Python

WebSocket client and server library for Python 2 and 3 as well as PyPy (ws4py 0.5.1)
https://ws4py.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
1.12k stars 288 forks source link

Will crash if sec-websocket-protocol has only one value #232

Open zexee opened 7 years ago

zexee commented 7 years ago

https://github.com/Lawouach/WebSocket-for-Python/blob/cdf50bdc373154a6388a7434b0dda363ab2ea8b5/ws4py/client/__init__.py#L336

I don't know much about websocket but when use this to connect libwebsocket-based server, it will crash, and the error comes from this line. The value is b'ws'. Simply change this line to protocols = value, and it works fine.