-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GRPC Web Proxy to enable Browser Integration and Eliminate Electron IPC #235
Comments
Once we can generate grpc-web stubs and have an in-process proxy. This means the grpc-web stubs should also be exported by js-polykey library to be usable. |
Current discussions about how to port over the Primary concern is to be able to run on the same port. We already use TLS. |
This is no longer relevant. With #249 we are now using JSON and our transport agnostic RPC. Which means browser's can just use websockets to contact our RPC system same as our client service. |
See #495 for converting to json RPC and @tegefaulkes we still need a new issue for your websocket work. |
Reopened #503 for websocket work for client service (which will be browser compatible). |
Specification
We can separate the networking to 3 layers:
The RPC layer is what enables us to have rich communication protocols for:
At the moment we have incorporated GRPC into js-polykey with the usage of these libraries:
This is working great for Agent to Agent and Client to Agent communication. However there are some challenges:
There is a solution called GRPC-web. It's discussed here: https://grpc.io/blog/state-of-grpc-web/
The basic idea is to use a separate client library for the browser that uses browser-native protocols to perform GRPC operations.
There are some challenges here:
scripts/proto-generate.sh
, it's just an additional output.Having GRPC-Web supported and an in-process proxy would mean:
Additional context
Note that there are multiple transports available in the libraries: https://github.com/improbable-eng/grpc-web/blob/master/client/grpc-web/docs/transport.md#built-in-transports. It seems to claim that websocket based transports actually enable both client and duplex streaming, so I'm guessing there's no need to ever go down the route of HTTP2 based transports and just focus on web socket transports?
At any case, for our usecase as we expect a limited deployment environment (browser extensions on latest browsers), it's fine to support only 1 transport.
Tasks
The text was updated successfully, but these errors were encountered: