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

Rewrite router using starlette #17

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

RealOrangeOne
Copy link
Contributor

Replaces #5

Features:

  • Nicely logs the hostname the request is for
  • asyncio-based, so has higher throughput, and doesn't get locked down when more than 4 requests come in at once
  • Streaming requests, so the router doesn't internally buffer things
  • Returns server: crab header
  • Uses uvicorn, a production-grade server, rather than a dev server

router.py Outdated
HEADERS_TO_STRIP = ["server", "date"]


client = httpx.AsyncClient()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

httpx's default timeout is 5 seconds. Need to use timeout=None i think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants