Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add http/2 support #568

Merged
merged 4 commits into from
Sep 22, 2024
Merged

feat: add http/2 support #568

merged 4 commits into from
Sep 22, 2024

Conversation

kemingy
Copy link
Member

@kemingy kemingy commented Sep 20, 2024

hyper can serve the traffic with HTTP/1.1 & HTTP/2.

Verified with curl -I --http2-prior-knowledge -w '%{http_version}\n' http://127.0.0.1:8000/metrics.

Signed-off-by: Keming <kemingy94@gmail.com>
@github-actions github-actions bot added the enhancement New feature or request label Sep 20, 2024
@kemingy
Copy link
Member Author

kemingy commented Sep 20, 2024

For Python httpx, you will need:

import httpx

# force to use HTTP/2
client = httpx.Client(http1=False, http2=True)
resp = client.post('http://127.0.0.1:8000/inference', json={'time': 0})

print(resp.http_version)

Signed-off-by: Keming <kemingy94@gmail.com>
@lkevinzc
Copy link
Member

Now the server will only support http/2? Will it be better to let user configure?

@kemingy
Copy link
Member Author

kemingy commented Sep 21, 2024 via email

lkevinzc
lkevinzc previously approved these changes Sep 21, 2024
README.md Outdated Show resolved Hide resolved
lkevinzc and others added 2 commits September 21, 2024 13:37
Signed-off-by: zclzc <38581401+lkevinzc@users.noreply.github.com>
Signed-off-by: Keming <kemingy94@gmail.com>
@kemingy kemingy merged commit f0ea3b5 into mosecorg:main Sep 22, 2024
19 of 20 checks passed
@kemingy kemingy deleted the http2 branch September 22, 2024 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants