Closed jacektrocinski closed 3 years ago
What did you type in the address bar in Firefox? You should use http://localhost:5000
, since you are requesting a web page. The JavaScript code in this application will make the WebSocket connection.
Yes, that is what I did, you can see the error here:
Here are the exact steps to reproduce the issue, in the example
folder:
$ py -m venv venv
$ py -m pip install flask
$ py -m pip install flask_sock
$ py -m pip install "werkzeug>=2.0.0rc3"
$ FLASK_APP="echo.py" flask run
* Serving Flask app "echo.py"
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [17/May/2021 16:46:08] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [17/May/2021 16:46:08] "GET /echo HTTP/1.1" 400 -
Okay, thanks. I've found the problem, it is a bug in the Werkzeug changes I contributed. See https://github.com/pallets/werkzeug/issues/2131.
I'll work on a fix.
Ok, thanks Miguel.
A fix for this issue has been committed to Werkzeug towards the 2.0.2 release. You can verify the fix by installing Werkzeug's 2.0.x branch (or wait until a new release is made).
Confirmed, installed the 2.0.x branch and it is working, thanks!
py -m pip install -U https://github.com/pallets/werkzeug/archive/2.0.x.tar.gz
The example code does not work.
I have tried running the code in the
example
folder and have received the following error:However, the following command does work:
I have installed the following Python packages: