4 ms·
Hi, author of Sonora here. gRPC-Web is actually exactly what you want if you want gRPC but none of the TLS, HTTP2 etc pain. It "just works" on HTTP/1.1 like an
by __alexs 5y ago
Hi, author of Sonora here.
gRPC-Web is actually exactly what you want if you want gRPC but none of the TLS, HTTP2 etc pain. It "just works" on HTTP/1.1 like any other server.
The Google libraries are definitely a pain to use in Python and even if you've got all the HTTP2 stuff sorted already it doesn't play that nicely with existing code bases.
- CobrastanJorji 5y agoHey, I haven't tried using gRPC with Python yet but I had been considering it recently and now I'm worried. Could you give me an example of what sort of trouble I should expect? What sort of trouble is it going to give my existing code base?
- __alexs 5y agoThe first issue I've seen people struggle with are to do with generating the Python bindings in the right modules. Getting the right combination of arguments to protoc isn't always obvious. The main complexity with an existing code base is that gRPC runs its own ioloop so it controls the server entirely so you can't glue it into an existing Python webapp easily. You can call all your existing Python functions etc just fine though.
- CobrastanJorji 5y agoInteresting, thank you!
- languagehacker 5y agoNifty. I assume this still means using some combination of Envoy + Nginx to "downgrade" to 1.1 in a traditional web service environment if the client defaults to HTTP/2. Is that right?
- no_circuit 5y agogRPC is HTTP/2. I'd say its more of a situation that you need to "upgrade" 1.1 clients. See https://www.envoyproxy.io/docs/envoy/v1.17.4/configuration/http/http_filters/grpc_json_transcoder_filter#config-http-filters-grpc-json-transcoder https://www.envoyproxy.io/docs/envoy/v1.17.4/configuration/h.... NGINX isn't necessary unless you need it in addition for some connection handling / performance concerns. Otherwise the gRPC handling I believe is best with just Envoy alone.
- __alexs 5y agoI don't think there is actually a good solution for connecting a regular H2 gRPC client to a gRPC-Web server currently. Envoy's gRPC-Web filter only seems to go the other way. I haven't tested it but the old HTTP/1.1 reverse bridge might work. [0] [0] https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_http1_reverse_bridge_filter https://www.envoyproxy.io/docs/envoy/latest/configuration/ht...