Support websockets 8.x as well as 7.x (#1687)
Sanic currently requires websockets 7.x, but it's straightforward to also support the more recent 8.x.
This commit is contained in:
parent
c54a8b10bb
commit
134c414fe5
|
@ -119,6 +119,9 @@ class WebSocketProtocol(HttpProtocol):
|
|||
read_limit=self.websocket_read_limit,
|
||||
write_limit=self.websocket_write_limit,
|
||||
)
|
||||
# Following two lines are required for websockets 8.x
|
||||
self.websocket.is_client = False
|
||||
self.websocket.side = "server"
|
||||
self.websocket.subprotocol = subprotocol
|
||||
self.websocket.connection_made(request.transport)
|
||||
self.websocket.connection_open()
|
||||
|
|
Loading…
Reference in New Issue
Block a user