Error in handling protocol
https://github.com/Lawouach/WebSocket-for-Python/blob/7f43f2a6bff1aabafad023652042439d7b9b8d84/ws4py/client/init.py#L312-L316
The value will be b'chat' if using same handshake information like the one on wiki.
So using join will result in TypeError: sequence item 0: expected str instance, int found.
I notice this code haven't been changed for 5 years. And I try to find an example of cherrypy and ws4py which contain a setting of Sec-WebSocket-Protocol for websocket server. But I can't find any. I also check the handshake information sent by simple example, and it didn't contain a Sec-WebSocket-Protocol header.
A more astonishing thing is there is no test about Sec-WebSocket-Protocol in test_client.py.
I think it should be fixed like this
elif header == b'sec-websocket-protocol':
protocols.append(value.decode('utf-8'))
elif header == b'sec-websocket-extensions':
extensions.append(value.decode('utf-8'))