grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.45k stars 760 forks source link

mode=grpcweb support server streaming in http2 actually #1391

Closed jmzwcn closed 6 months ago

jmzwcn commented 6 months ago

mode=grpcwebtext: The default generated code sends the payload in the grpc-web-text format.

Content-type: application/grpc-web-text Payload are base64-encoded. Both unary and server streaming calls are supported. mode=grpcweb: A binary protobuf format is also supported.

Content-type: application/grpc-web+proto Payload are in the binary protobuf format. Only unary calls are supported for now. ==> Both unary and server streaming calls are supported.

sampajano commented 6 months ago

Thanks so much for the info!!

See https://github.com/grpc/grpc-web/discussions/1322#discussioncomment-7804499

I'd like to have one more confirmation here before i update our docs! 😃

jmzwcn commented 6 months ago

Furthermore, I find based on grpc-web, we could directly send pb msg to grpc-server without any proxy.

https://github.com/emart-io/cross/blob/main/zwan/internal/cmd/main.go#L49

sampajano commented 6 months ago

Furthermore, I find based on grpc-web, we could directly send pb msg to grpc-server without any proxy.

https://github.com/emart-io/cross/blob/main/zwan/internal/cmd/main.go#L49

@jmzwcn Aha interesting! Good to note!! I guess grpc-server would have recently added grpc-web support..?

jmzwcn commented 6 months ago

No, if server stream is always sending without stop, grpc-web client will don't fetch those stream.