Open u3shit opened 8 months ago
Sorry, I haven't noticed you added a CoC in the meantime.
Probably the correct way to handle this is to check whether the HTTP/2 connection advertises support for the connect protocol, and if not, fall back to HTTP/1 for WebSockets.
I did what I shouldn't do and updated everything at one time again, and now I can no longer connect to a websocket server behind an nginx reverse proxy.
A simple program like this
Now fails (removed IP addresses):
And it just hangs there until I Ctrl-C it. Nginx sends back a HTTP 400 error page (verified with wireshark), but this lib doesn't seem to handle it. Additionally nginx logs a
client sent unknown pseudo-header ":protocol" while reading client request headers
error, so I think it doesn't support websocket over HTTP2. (The older version I upgraded from used HTTP/1.1 so it worked fine there).The
alpn_protocols: Async::HTTP::Protocol::HTTP11.names
workaround fixes the problem, but I think it should at least error out on the 400 response, instead of hanging the coroutine.