WARNING: Unsupported upgrade request.
See original GitHub issueapp = FastAPI()
@app.websocket("/ws")
async def websoc(websocket: WebSocket):
await websocket.accept()
await websocket.send_json({"msg": "Hello WebSocket"})
await websocket.close()
When attempting to run this (using UviCorn), it starts fine
then, when i try and use my client to connect the the websocket, i get this error
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
>>> runfile('C:/Users/Tobi/Documents/Scripting/Mixed/Webpage/main.py', wdir='C:/Users/Tobi/Documents/Scripting/Mixed/Webpage')
INFO: Started server process [9580]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://192.168.1.88:80 (Press CTRL+C to quit)
**WARNING: Unsupported upgrade request.**
This is my client code, its just supposed to be a very simple test
import websocket, time
ws = websocket.create_connection("ws://192.168.1.88/ws")
while True:
ws.recv()
time.sleep(2)
Let me know if you can help, or if anyone else has had similar issues with this.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:12 (1 by maintainers)
Top Results From Across the Web
FastAPI (Python) Why I get "Unsupported upgrade request ...
This same issue usually seems to arise from incomplete uvicorn installations, but is usually related to websockets.
Read more >Unsupported upgrade request. - solved - Prodigy Support
Hi, I have recently upgraded my prodigy licence from the previous version 1.10(spaCy v2) to the latest version using spaCy v3.
Read more >If you are getting `Unsupported upgrade request error` from ...
If you are getting `Unsupported upgrade request error` from uvicorn that means you just need to pip install websockets packedge.
Read more >tiangolo/fastapi - Gitter
I'm trying to connect to my own FastAPI websocket endpoint I just put up to test, and it's giving me bad request. WARNING:...
Read more >otree 5 behind nginx: Unsupported upgrade request
otree 5 behind nginx: Unsupported upgrade request ... uvicorn - this does indeed seem to solve the issue, but I get the following...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As suspected, this was a uvicorn issue, not FastAPI, however, to fix this, for anyone else curious, goto terminal and type
then
The original uvicorn package doesnt come with websocket support, you have to download the standard one.
Had the same issue.
did the job