Closed NguyenKhong closed 1 year ago
I don't think you are correct. I tested this in a Python session:
>>> from wsproto.events import CloseConnection
>>> c = CloseConnection(1000, 'close')
>>> c
CloseConnection(code=1000, reason='close')
What version of wsproto do you have installed in your virtualenv?
I use wsproto-0.14.1. May be it too old. I update to the last version and it is good working.
This a line out_data = self.ws.send(CloseConnection(reason or CloseReason.NORMAL_CLOSURE, message)) in a ws.py file at line 125, throw exception TypeError: init() takes 1 positional argument but 3 were given.
The class CloseConnection only accept *kwargs but pass into args, so it throw a exception. I so hope the author will fix it.