Server streaming is not working with gRPC-web #2165
Unanswered
Gumichocopengin8
asked this question in
Q&A
Replies: 2 comments 11 replies
-
for grpc-web, binary stream is not working only text stream works. protobuf-ts works with binary. |
Beta Was this translation helpful? Give feedback.
1 reply
-
i use only: Server::builder()
.add_service(
tonic_web::enable(
MicroServiceServer::new(greeter)
)
)
.serve(addr)
.await?; in tonic, where greeter is the service. match tx.try_send( instead of match tx.send( But for web i used protobuf-ts because i use angular. |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I use Tonic and Tonic-Web for gRPC-Web without Envoy proxy (as far as I know Tonic-Web takes over Envoy roll).
the Tonic gRPC works in browser network but the
.on('data', (data) => {})
callback in frontend does not work. Not sure if it's a tonic issue or gRPC-web issue or my code issue.Here's the detailed code.
I used this official example for server streaming.
tonic/examples/src/streaming/server.rs
Lines 44 to 81 in 86815d8
and the following code is the rest of the Rust code.
in frontend (React19 + Vite + gRPC-web),
I use
"google-protobuf": "^3.21.4"
,"grpc-web": "^1.5.0"
.protoc command for gRPC-web
protoc -I=./proto \ --js_out=import_style=commonjs,binary:./src\ --grpc-web_out=import_style=typescript,mode=grpcweb:./src\ ./proto/*.proto
Beta Was this translation helpful? Give feedback.
All reactions