Skip to content

Conversation

@anuraaga
Copy link
Collaborator

After much testing of various servers, I finally found the words for a deployment doc. Happy for any suggestions as this was the least mechanical of any of the docs

Signed-off-by: Anuraag Agrawal <[email protected]>
Copy link
Member

@stefanvanburen stefanvanburen left a comment

Choose a reason for hiding this comment

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

lgtm, just a suggestion on the CORS section

Comment on lines +51 to +56
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["GET", "POST"],
allow_headers=["*"],
)
Copy link
Member

Choose a reason for hiding this comment

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

the * seems a little loose to me; could we:

  1. for allow_origins, add a comment to "replace with your domain" (similar to cors-go example)
  2. add comments to GET and POST for why they're needed (GET for connect, POST for connect/gRPC)
  3. pull in the headers w/ comments from cors-go?

We may eventually want to have a cors-go equivalent in python for ease of adding these headers, but adding these seems like enough for now.

using HTTP/1.1 without issue. Two servers have long been in use with HTTP/1.1 and have a proven track
record. If you are unsure what server to use, it is generally a safe bet to use one of them:

- [gunicorn](http://www.gunicorn.org/) for WSGI applications
Copy link
Contributor

@i2y i2y Nov 22, 2025

Choose a reason for hiding this comment

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

maybe https:// is better?

- [uvicorn](https://uvicorn.dev/) for ASGI applications

### HTTP/2

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure and forgot about daphne. Should we mention daphne as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately Daphne's http2 support doesn't work with bidi so I think it's confusing to add to this list. And without it, I think uvicorn is a better choice so left it out.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately Daphne's http2 support doesn't work with bidi so I think it's confusing to add to this list. And without it, I think uvicorn is a better choice so left it out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, I see.

Comment on lines +26 to +29

- [granian](https://github.com/emmett-framework/granian)
- [hypercorn](https://hypercorn.readthedocs.io/en/latest/)
- [pyvoy](https://github.com/curioswitch/pyvoy)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd love to improve https://github.com/i2y/tsuno so it can be on this list someday! (just a comment)

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.

3 participants