"Invalid frame header" #96
Replies: 6 comments
-
When I try to connect through WSS instead of WS:
|
Beta Was this translation helpful? Give feedback.
-
If you are going to use WSS you have to configure TLS in your server, you can't just send encrypted traffic to a regular server. For the invalid frame header error, I suggest you retest using Gunicorn, which is the supported production web server. You are using Werkzeug which is not fully compatible with WebSocket. Some Werkzeug versions have minor WebSocket issues at disconnect time. |
Beta Was this translation helpful? Give feedback.
-
Then by any chance, do you know how to configure TLS in Windows? |
Beta Was this translation helpful? Give feedback.
-
Also I don't really mind whether do I want WS or WSS, I just want a WebSocket port in my Flask server. That's all I'd want. |
Beta Was this translation helpful? Give feedback.
-
Gunicorn does not run on Windows, unfortunately. Can you use WSL? That would allow you to run the UNIX version of Gunicorn on your Windows machine. TLS is configured on your web server. For Gunicorn, you pass command line options to set up your certificate and key files. |
Beta Was this translation helpful? Give feedback.
-
Looks like my crappy code can't run locally. Too bad. 😔 |
Beta Was this translation helpful? Give feedback.
-
Hello there. I've ran into a large problem with (probably) my first time use of
Flask-Sock
. Basically, when client or server closes the connection, the browser (client) gets a "Invalid frame header" error and the console says that the WS connection was an HTTP request, something like this:To replicate my problem, this code should do the "trick":
Browser code (ran in Chrome DevTools)
I've tried doing lots of things to debug it, but nothing fought out the error. Can you help?
Beta Was this translation helpful? Give feedback.
All reactions