I want to expose proto file for clients through HTTP as REST endpoint. I want to call this endpoint and get a raw proto file. Can I do this with gRPC.serveHTTP or not? Maybe you can advise some better ways to share a proto file with clients. Thanks!
I'm trying to do something similar. My goal is to enable clients to connect to the service without having to have the proto file baked in to their own source. From my limited understanding of gRPC, reflection would be the idiomatic way of doing this. However, it seems that reflection is not implemented in grpc-node at this time (https://github.com/grpc/grpc/issues/2568).
@VMois @Lange
Have you been able to achieve this yet? We are looking to do something similar.
@kashifmin No, I unfortunately have not. I've given up on pursuing this for now.
@kashifmin No, also gave up.
Does this ticket aim to track the support of reflection on the server, client, or both? Is it already somehow possible to invoke the reflection service from Node.js clients?
We don't have any reflection support at the moment, neither from the client or the server. That being said, the ticket is mainly aimed at tracking server side reflection. Client side should be doable manually using the reflection protocol.
Thinking about it more, I realized that I just said something stupid: both client and server are doable with no change in the core packages. In fact, we probably should build these as new packages.
Yeah, I'm studying how the whole thing works. Seems like client-side support is easily attainable by generating the code for the reflection protocol. Do you think this could be simply made into its own package without any addition?
Server-side instead would need a full implementation of the protocol, right?
I'd say it's probably better to have two different packages, one for clients and one for servers. Does this make sense?
Yes, this makes sense. Both should be doable without any addition.
Regarding the server, what do you mean "without addition"? I assumed you would have had to somehow implement the reflection protocol.
AFAIK, the reflection protocol is just a normal RPC. So you don't need to do anything special in the existing grpc code. You can simply add the appropriate RPC route for it to a server object taken as a constructor argument for instance.
any progress?
Reflection really creates barrier for entry. Do we have any chance yet?
Most helpful comment
I'm trying to do something similar. My goal is to enable clients to connect to the service without having to have the proto file baked in to their own source. From my limited understanding of gRPC, reflection would be the idiomatic way of doing this. However, it seems that reflection is not implemented in grpc-node at this time (https://github.com/grpc/grpc/issues/2568).