pgjones / hypercorn

Hypercorn is an ASGI and WSGI Server based on Hyper libraries and inspired by Gunicorn.
MIT License
1.05k stars 94 forks source link

Websocket endpoint and ProxyFixMiddleware #198

Open hhakk opened 4 months ago

hhakk commented 4 months ago

I deployed a Quart app on Azure (using Docker), and they have some kind of reverse proxy that decrypts HTTPS traffic to HTTP traffic.

Now if I apply ProxyFixMiddleware and use url_for(<websocket-endpoint>) in my template, I correctly get a wss address rendered BUT Quart always responds with HTTP 400.

If I do not apply the middleware and manually set the protocol to wss on the template, I can succesfully establish a websocket connection. Why is this?

Using quart = 0.19.4 and hypercorn = 0.16.0

pgjones commented 1 month ago

Does the url_for result differ in the two circumstances? If so could you share the values