-
Notifications
You must be signed in to change notification settings - Fork 91
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
Is Hypercorn server serving up response using HTTP/2 #220
Comments
AFAIK, chrome will only initiate an H2 connection over SSL/TLS. So you could create a self-signed cert and have hypercorn present it either via the config class or via the command line. Chrome will obviously error on invalid cert but you can then ignore the error. It will then initiate an HTTP/2 connection. Hope this helps. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is the implementation stub
from hypercorn.config import Config as HyperCornConfig
from hyercorn.asyncio import serve
import asyncio
class FastApiServer:
def init(self) -> None:
self._hypercorn_config = HyperCornConfig()
self._fastapi_instance = get_fast_api_instance()
async def main():
fastapiserver = FastApiServer()
await fastapiserver.run_server()
if name == "main":
asyncio.run(main())
When running in local , on Chrome, the API call gives a response. but on Protocol (in developer's tool) it shows http/1.1 and not http/2.
what am i missing?
The text was updated successfully, but these errors were encountered: