Skip to content
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

Proxy needed for browser? #199

Closed
pusolito opened this issue Oct 7, 2023 · 6 comments
Closed

Proxy needed for browser? #199

pusolito opened this issue Oct 7, 2023 · 6 comments

Comments

@pusolito
Copy link

pusolito commented Oct 7, 2023

I've seen that gRPC requires a proxy server on the backend when used from browsers, which do not provide the low-level access to HTTP2 that gRPC needs. But I don't see that mentioned in the docs, like it is in the grpc-web docs. Can you confirm whether a proxy is still needed?

@andrewparmet
Copy link
Collaborator

andrewparmet commented Oct 7, 2023

Yes, a proxy is still needed. Protokt's JS gRPC runtime implementation is a wrapper around grpc-js so it inherits both good and annoying baggage.

@pusolito
Copy link
Author

pusolito commented Oct 7, 2023

I assume this means bundle size is also a bit bigger since gRPC-web creates its own code and protokt has to provide wrappers around those JS message types the client to make the APIs more idiomatic Kotlin. Is that right?

Also, why is the your browser support considered alpha still given gRPC-web is fairly far along?

@andrewparmet
Copy link
Collaborator

I'm not sure about the bundle size; I've never used grpc-web.

Protokt's JS implementations are brand new.

Protokt's support for serialization and deserialization in JS is not alpha - it passes all the same conformance tests as the JVM implementation.

The gRPC runtime for JS is alpha - there are tests covering happy paths for each type of call, but it's likely that error propagation doesn't work properly in all cases. For example, it's possible that a StatusException (defined in this project to be analogous to grpc-java's StatusException) with a particular gRPC status may not be received by the client as the same status.

@pusolito
Copy link
Author

pusolito commented Oct 7, 2023

This is really helpful. I'll give the library a shot.

I appreciate the work something like this takes. So thank you and keep it up.

@andrewparmet
Copy link
Collaborator

Feel welcome to open an issue for any bugs or feature requests. I don't know the JS ecosystem well enough to know what may be missing, especially for browser support of gRPC clients.

@andrewparmet
Copy link
Collaborator

Closing with grpc-web support covered by #202.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants