-
Notifications
You must be signed in to change notification settings - Fork 164
Set websocket=True for Rule, fixes #81 #82
base: master
Are you sure you want to change the base?
Conversation
Unfortunately, Werkzeug pre 2.0.0 doesn't always label websocket requests correctly, so with this PR, you can end up with the opposite mismatch. Here's the change to Werkzeug where more websocket requests get labelled correctly: https://github.com/pallets/werkzeug/pull/2053/files#diff-9b2e55f893697ae8ac344aebf17bebee83546fc2bf4d8e1b138cf7c63e92080fR1637-R1641 |
Hi @tomviner, I ended up with a similar change to make things work on my side, but in addition to your commit I also had to add the following change:
In my tests this makes
|
@tomviner thanks for this fix. It looks like it fixes most of my problems with the Flask upgrade.
Maybe also add the constraint |
If there's an issue with misrecognizing sockets, maybe the solution would be to use the options kwargs instead?
And then you'd use it thus:
Older versions of flask_sockets would ignore that, so an app that sets this flag would be compatible with both. |
This solution would solve it, so someone really needs to fix that! It's an easy fix, and would help a lot. |
This fixes the
WebsocketMismatch
which appears with Werkzeug 2.0.0.The cause is a websocket request hits a rule which Werkzeug doesn't think is a websocket endpoint.