scalapb/scalapb-grpcweb

[Feature Request] Trigger gRPC Web Call Without Node (java script)

Closed this issue · 2 comments

Note: Even though it is not proper forum to make requests or ask questions, I didn't find any other proper channel

I used an example mentioned in https://github.com/scalapb/scalapb-grpcweb/tree/master/example to trigger an RPC call from a web browser towards an envoy (later it translates gRPC-web+proto http/1.1 to gRPC http/2 towards gRPC server)

Is there any way to trigger grpc-web related RPC towards envoy without using scala js (node) by simply using pure Scala. I can see in order generate Scala code from proto messages there were few scala js related dependencies and cross compilation involved in project. But would like to use library without any involvement of scala js. is it possible to do that ?

  • Compile proto files using your code generator without need of cross platform related stuff just like scalpb-runtime or scalapb-runtime-grpc
  • Use generic gRPC ways of creating a channel and making gRPC call using stubs without using npm and scala js

I got to know that "gRPC-Web is meant to be run from the browsers only" that's why your example also intended to run from browser, but would like mimic browser behavior of calling gRPC methods in pure Scala for my need

Hi @UserNoOne , scalapb-grpcweb relies on grpc-web to communicate with Envoy proxy. grpc-web is written in Javascript and therefore scalapb-grpcweb can only be used with Scala.js and is not available for the JVM. I am also not aware also of a grpc-web client library for the JVM, so for the time being, there is no plan to support the feature you are requesting.

Compile proto files using your code generator without need of cross platform related stuff just like scalpb-runtime or scalapb-runtime-grpc

This part of your question is unclear. scalapb-runtime and scalapb-runtime-grpc providesupport for protocol buffers/gRPC in Scala on the JVM, so it is inconsistent with the overall request for grpc-web support on the JVM.

@thesamet As scalapb-runtime and scalapb-runtime-grpc providing support for protobuf/gRPC in scala for JVM and i have seen scalpb-grpc-web generate scala classes and js with some custom signature for grpc-web. So, i thought same thing will be possible for jvm application

Thanks for quick response