grpc-web icon indicating copy to clipboard operation
grpc-web copied to clipboard

Node-based proxy

Open paralin opened this issue 9 years ago • 10 comments

Some things I am interested in doing:

  • Running the proxy in a Node.JS process
  • Allowing arbitrary transport to the proxy (websocket, any other two-way link like WebRTC)

paralin avatar Oct 21 '16 06:10 paralin

Done here: http://github.com/paralin/grpc-bus

Any comments?

paralin avatar Nov 02 '16 23:11 paralin

Cool. Any doc on the supported transport/protocols?

wenbozhu avatar Nov 02 '16 23:11 wenbozhu

@wenbozhu supports literally anything. You give it a function for send(message) {} and it expects that message to end up at handleMessage(message) on the server. Also, the thing passed to send() is a ProtoBuf message so it supports binary serialization.

paralin avatar Nov 03 '16 00:11 paralin

Thanks for the update!

Are you interested in implementing the grpc-web spec in the Node proxy?

https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md

There is already a Go proxy from Improbable. We are happy to review the Node proxy implementation and include the Node proxy in grpc-web interoperability test suite.

wenbozhu avatar Jun 06 '17 19:06 wenbozhu

I've taken a stab at this, because we needed it ourselves for something: https://github.com/dataform-co/dataform/tree/master/tools/grpc-web-proxy

It seems to be working well for unary calls, I haven't had a chance to test it for streaming yet! Would be happy to discuss moving this somewhere official, but not sure I have the time to do that myself.

lewish avatar Nov 04 '19 19:11 lewish

@lewish This looks promising! Let us check this out and we can discuss where it's more appropriate to host this later. Thanks!

stanley-cheung avatar Nov 05 '19 23:11 stanley-cheung

@lewish I'm late for the party, your link goes to 404. Did you ever end up finishing that implementation so that it supports streaming as well? :-)

petermetz avatar Aug 08 '21 03:08 petermetz

@lewish I'm late for the party, your link goes to 404. Did you ever end up finishing that implementation so that it supports streaming as well? :-)

maybe this? https://github.com/dataform-co/dataform/tree/master/grpc-web-proxy

tiero avatar Nov 27 '21 23:11 tiero

@tiero Thank you! Unfortunately it says in the readme on that link that This has only been tested with unary gRPC calls. :-(

petermetz avatar Nov 30 '21 22:11 petermetz

@petermetz I tested for my use case where I use grpc-web-text (ie. messages are encoded as base64) and is not supported either, guess is same reason only works for unary calls.

tiero avatar Dec 01 '21 10:12 tiero