Skip to content

Conversation

tomasol
Copy link
Contributor

@tomasol tomasol commented Jul 29, 2025

This change enables calling unary RPCs and response streaming from binaries built for the wasm32-wasip2 target.

@devashishdxt
Copy link
Owner

Thanks for working on this. I'm not sure if this crate is the right place to add support for this. Anyway, can you please add some tests?

@tomasol
Copy link
Contributor Author

tomasol commented Jul 30, 2025

I wasn’t sure either, but started exploring it and ended up completing it. No pressure, totally understand if it’s not the right fit.I'll add tests running on wasmtime.

tomasol added 4 commits July 30, 2025 16:19
This change enables calling unary RPCs and response streaming from
binaries built for the `wasm32-wasip2` target.
@tomasol tomasol force-pushed the wasip2 branch 2 times, most recently from eecda37 to 24d06a9 Compare July 30, 2025 17:38
@tomasol
Copy link
Contributor Author

tomasol commented Jul 30, 2025

The tests fit nicely, essentially I just replaced an annotation. The whole change that enables wasip2 is in call and it uses most of other modules like response_body, body_stream etc. Let me know if you have any concerns or questions!

@devashishdxt
Copy link
Owner

@tomasol Can a standard gRPC client run directly in a WASI environment?

I'm a little confused about why gRPC-Web would be necessary. I was under the impression that gRPC-Web is a workaround specifically for web browsers. Does WASI's networking model have similar constraints that prevent a standard gRPC implementation from working?

@tomasol
Copy link
Contributor Author

tomasol commented Aug 3, 2025

gRPC proper isn't currently supported in WASI, see this issue for context. While it's technically possible to send gRPC messages over HTTP/1, that requires non-standard server configs.

Even once full support lands in WASI runtimes, a gRPC-Web library could still be useful. For example, a WASI app might want to target gRPC-Web to integrate with existing infrastructure (e.g., sharing a port already exposed for gRPC-Web traffic).

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