-
-
Notifications
You must be signed in to change notification settings - Fork 845
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
HTTP/2 bi-directional streaming. #1150
Comments
First of all, many thanks for your work on A use case would be to use Python dominates the network world, hence this attempt of a low-level transport api in |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Thanks @Stale, I think we'd like to keep this open. Soz. It's probably more of a docs issue at this point than an enhancement, since the "network stream" extension does allow us to support this functionality. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
👉 With Supporting
The latter would be extremely valuable given that
If we consider the official example https://grpc.io/docs/languages/python/quickstart/ there is an example of
There is another publicly available example of
Note: You can omit the first 5 bytes of the response (when using
Referencing encode/httpcore#592 here as well for reasons of completeness, How do you feel about it? Is it a big chunk of work you (and the encode team) have to put in? |
I like it. |
Indeed, because In an effort to save 10min of your time, this is how I construct the byte sequence in question, in other words the
which is the equivalent of
|
is it a good idea to remove the |
At some point we ought to consider a low-level Transport API for exposing the functionality offered by the HTTP
CONNECT
method, the HTTPUpgrade
header, andHTTP/2
's bi-directional streaming. (Eg. as used by gRPC)All there of these essentially offer the same thing - a means of obtaining a raw connection over HTTP.
The connection itself might either be the actual TCP connection (HTTP/1.1) or just a single stream (HTTP/2), but this should be ~transparent to the user, except for the fact that we might want to expose some functionality such as "now start TLS on this connection" that is only appropriate in the HTTP/1.1 case.
One thing that's potentially a bit fiddly about the API, is that the connect request can either be accepted or rejected, and we've got different kinds of stream interfaces we want to expose in each case. (Ie if it's rejected, then we want to return a regular byte stream representing the HTTP response, otherwise we want to return some kind of
Connection
interface.)This issue is related to WebSockets support (which uses the HTTP
Upgrade
mechanism), but I think we want to provide a dedicated API for that use case, rather than building our websockets support on top of a low level connect mechanism.Would be useful to hear from any folks with use cases in this area.
Edit, Sept 6 2023: Retitled to reflect the last remaining item here.
The text was updated successfully, but these errors were encountered: