-
Notifications
You must be signed in to change notification settings - Fork 24
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
Additions to support gRPC #128
Comments
I agree that we should unblock gRPC over wasi-http. For the specific way of going about it, I wonder if we might be able to get away with something slightly less invasive:
The combination of these two would I think fully satisfy the requirements for making gRPC work, while not requiring any additions to the WIT interfaces of wasi-http. (And technically not even any spec changes, given that the list of forbidden headers isn't currently part of the spec itself.) At first glance, this suggestion (or the changes Joel suggests above) seem bad in that they aren't supportable in browser environments, because However, I'd argue that if anything allowing |
@tschneidereit In your proposal how would the implementation indicate that, although the client sent an HTTP/2 request, the server downgraded the response to e.g. HTTP/1.1? |
You're right, I didn't address that part. One possible answer would be that we'd expose that as a connection error, because it'd mean that there's no reliable way to support the required semantics. In practice, I would assume that someone who wants to use trailers (and hence sends |
Yes, also agreed on the goal of allowing gRPC to work over wasi-http. Riffing on Till's idea, could we add a method roughly like: resource outgoing-request {
...
expects-trailers: func() -> bool;
set-expects-trailers: func(required: bool);
} where setting |
That approach would work, and I agree that it'd be conceptually cleaner. It'd also come at significant cost to portability: it'd mean that any code that would "just work" under my proposal would instead have to be changed. That'll either affect code that's easy to change, but needs changing in many places (potentially multiple per application, with the risk of not catching all of them) or in hard-to-change ones, such as deep within frameworks/libraries that are slow to update, and often not under the interested party's control. Given that, I do wonder if the conceptual cleanliness is really worth it? |
As a quick heads-up, Joel and I talked about this in much more detail and realized that neither of the last two suggestions will really work. We did come up with an alternative that seems much better, which I'll sketch out here later today |
I didn't get around to this before EOD yesterday, but I now opened #129 with proposed API additions to address the requirements here. I wrote a long explanation of my reasoning behind this design in the PR, so won't repeat that here :) |
The design #129 proposes new interface per HTTP version. Joel's hack of wasmtime header validation bytecodealliance/wasmtime@main...dicej:wasmtime:grpc-hacks is just removing the header validation. Do I understand correctly that next steps here are
Am I missing some steps ? |
Recently, I've been trying to use a popular .NET library, Grpc.Net, to make outbound gRPC connections using a port of
System.Net.Http
to wasi-http. I was able to get it to work, but had to hack a few things:wasmtime-wasi-http
to use HTTP/2 for all outgoing requestsSystem.Net.Http
to assume incoming responses use HTTP/2wasmtime-wasi-http
'sis_forbidden_header
to allow all headersIdeally, none of those hacks would be necessary, so I'd like to propose the following additions to the wasi-http spec:
TE
headers, butwasmtime-wasi-http
might allow them (and indeed should allow them).outgoing-request
to specify the HTTP version to use. The implementation should return an error if it can't guarantee that version will be used.incoming-response
to retrieve the HTTP version of the response, e.g. as anoption<http-version>
wherehttp-version
is an enum type andnone
means the version is not known. This allows the client to detect if the server downgraded the connection to a lower version.See also bytecodealliance/wasmtime#7538 for further discussion.
The text was updated successfully, but these errors were encountered: