Protocol upgrade request not supported with Java Client #1965
Replies: 2 comments 3 replies
-
(I've found many stack overflow threads that relate the same kind of issues (see for example:
but none of them seem to solve my issue. I can reproduce without Docker In my understanding, if Uvicorn cannot use WebSockets, it should not accept the upgrade. I'm not quite sure what is exactly failing. I couldn't make my build more "clean", it literally uses the The main function also contains
as preliminary check, but still no change |
Beta Was this translation helpful? Give feedback.
-
How are you running your server? Command please. Run |
Beta Was this translation helpful? Give feedback.
-
Hello, I've been running an application (framework less!) with GUnicorn and Uvicorn. The set-up goes as the documentation in Uvicorn explains: use the default worker class for GUnicorn, and install Uvicorn using:
Everything is actually inside a Docker (which explicitly runs the above line, plus other dependencies) and this is the result of
pip freeze
:There is nothing specific in the configuration of GUnicorn (except the worker class
'uvicorn.workers.UvicornWorker'
.Everything is working really fine and I can use psycopg in asynchronous mode for example. I have no issue when issuing
curl
requests. However, when I attack my server with a Java client, I get those errors:This is confusing me, because that's exactly how I installed the Uvicorn dependency. Moreover,
websockets
clearly is in the pip freeze result. I know the HttpClient of Java can be tweaked to stick to HTTP 1.1, but I haven't done it (actually I don't own the client process). By default, it looks like it tries to upgrade to websocket protocol.My question is: did anyone already solved the issue (so really solved it, without asking to re-install nor downgrade the client explicitly). In my understanding, it should just work out of the box. But maybe I've missed some configuration somewhere.
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions