pgjones / hypercorn

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

HTTP/2 prioritisation is not working #144

Closed winstxnhdw closed 1 year ago

winstxnhdw commented 1 year ago

This is what the server log printed.

[2023-09-17 20:01:30 +0000] [1] [INFO] 200 "POST /v1/translate 1.1" 10.16.38.82:51754 "curl/8.3.0"

This is what cURL printed.

*   Trying 34.230.185.26:443...
* Connected to winstxnhdw-nllb-api.hf.space (34.230.185.26) port 443
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: none
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=hf.space
*  start date: Jun  7 00:00:00 2023 GMT
*  expire date: Jul  5 23:59:59 2024 GMT
*  subjectAltName: host "winstxnhdw-nllb-api.hf.space" matched cert's "*.hf.space"
*  issuer: C=US; O=Amazon; CN=Amazon RSA 2048 M01
*  SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://winstxnhdw-nllb-api.hf.space/v1/translate
* [HTTP/2] [1] [:method: POST]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: winstxnhdw-nllb-api.hf.space]
* [HTTP/2] [1] [:path: /v1/translate]
* [HTTP/2] [1] [user-agent: curl/8.3.0]
* [HTTP/2] [1] [accept: */*]
* [HTTP/2] [1] [update: h2c]
* [HTTP/2] [1] [content-type: application/json]
* [HTTP/2] [1] [content-length: 83]
> POST /v1/translate HTTP/2
> Host: winstxnhdw-nllb-api.hf.space
> User-Agent: curl/8.3.0
> Accept: */*
> Update: h2c
> Content-Type: application/json
> Content-Length: 83
>
< HTTP/2 200
< date: Sun, 17 Sep 2023 20:01:30 GMT
< content-type: application/json
< content-length: 24
< server: hypercorn-h11
< link: <https://huggingface.co/spaces/winstxnhdw/nllb-api>; rel="canonical"
< x-proxied-host: http://10.19.3.151:7860
< x-proxied-path: /v1/translate
< x-request-id: 59259d78-e1fa-4739-a92a-9fdcf0c8f8d9
<
* Connection #0 to host winstxnhdw-nllb-api.hf.space left intact
winstxnhdw commented 1 year ago

@pgjones It seems Hypercorn's HTTP/2 has been broken entirely. You can see the regression here.

pgjones commented 1 year ago

You'll need to provide more information for me to investigate this. At the moment I'm unsure why you think HTTP/2 is broken. Also the image linked isn't readable.

winstxnhdw commented 1 year ago

That's weird since the image is from the blog you wrote.