grpc web
约 1 分钟阅读
- gRPC WebGitHub 文件grpc/grpc/doc/PROTOCOL-WEB.mdgRPC Web · grpc/grpc-web · nginx · ngxhttpgrpcmodule · Introducing gRPC Support with NGINX 1.13.10 · envoy · improbable-eng/grpc-web笔记:grpc web
- grpc/grpc-webGitHubgrpc/grpc-webgRPC Web · grpc/grpc-web · nginx · ngxhttpgrpcmodule · Introducing gRPC Support with NGINX 1.13.10 · envoy · improbable-eng/grpc-web笔记:grpc web
- nginx
- envoy
- improbable-eng/grpc-webGitHubimprobable-eng/grpc-webgRPC Web · grpc/grpc-web · nginx · ngxhttpgrpcmodule · Introducing gRPC Support with NGINX 1.13.10 · envoy · improbable-eng/grpc-web笔记:grpc web
- 直接使用 go 作为代理
- 支持 unary 和 server stream
- nice-grpc-webGitHub 文件deeplay-io/nice-grpc/packages/nice-grpc-webgRPC Web · grpc/grpc-web · nginx · ngxhttpgrpcmodule · Introducing gRPC Support with NGINX 1.13.10 · envoy · improbable-eng/grpc-web笔记:grpc web
- 基于 @improbable-eng/grpc-web
- 接口更加友好
- kong grpc-web链接docs.konghq.com/hub/kong-inc/grpc-webgRPC Web · grpc/grpc-web · nginx · ngxhttpgrpcmodule · Introducing gRPC Support with NGINX 1.13.10 · envoy · improbable-eng/grpc-web笔记:grpc web 插件
- 如果没有原始 proto 只能支持二进制编码
application/grpw-web+protoapplication/grpc-webapplication/grpc-web-textapplication/grpc-web-text+proto
- 如果有原始编码,则可以支持转码
application/grpc-web+jsonapplication/grpc-web-text+json
- 如果 kong 是通过数据库多节点部署的,那比较难有 proto 文件
- 如果没有原始 proto 只能支持二进制编码
Awesome
- web pkg
- google-protobuf - 230kB/46kB
- grpc-web - 35kB/13kB
new MyService()- xhr
- @improbable-eng/grpc-web - 24kB/7kB
grpc.{unary,invoke,client}
- protobufjs/protobuf.jsGitHubprotobufjs/protobuf.js
- thesayyn/protoc-gen-tsGitHubthesayyn/protoc-gen-ts
- 暂不支持 grpc-web
- improbable-eng/ts-protoc-genGitHubimprobable-eng/ts-protoc-gen
- 支持 grpc-web,开发不活跃
- fetch
- bufbuild/protobuf-esGitHubbufbuild/protobuf-esbufbuild/protobuf-es · Apache-2.0, TS · protoc-gen-es · target - 默认为 js+dts · js - 生成 · ts - 生成 · dts - 生成 · importextension - import 的后缀笔记:protobuf-es
- 未来会支持 RPC
- @bufbuild/protobuf
- nodejs
- @grpc/grpc-js
- @grpc/proto-loader
Protocol
mode=grpcwebtextContent-type: application/grpc-web-textapplication/grpc-web-text+[proto,thrift]- Base64 编码
- 支持 unary 和 server streaming
mode=grpcwebContent-type: application/grpc-web+protoapplication/grpc-web+[proto,json,thrift]- 默认 +proto
- 二进制编码
- 只支持 unary
plugins:
- name: grpc-web
out: gen/web
opt: mode=grpcwebtext- import_style - closure,commonjs,commonjs+dts,typescript
- mode - grpcwebtext,grpcweb
关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub8 条
- bufbuild/protobuf-esgithub.com/bufbuild/protobuf-es
- deeplay-io/nice-grpc/packages/nice-grpc-webgithub.com/deeplay-io/nice-grpc/tree/master/packages/nice-grpc-web
- grpc/grpc-webgithub.com/grpc/grpc-web
- grpc/grpc/doc/PROTOCOL-WEB.mdgithub.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md
- improbable-eng/grpc-webgithub.com/improbable-eng/grpc-web
- improbable-eng/ts-protoc-gengithub.com/improbable-eng/ts-protoc-gen
- protobufjs/protobuf.jsgithub.com/protobufjs/protobuf.js
- thesayyn/protoc-gen-tsgithub.com/thesayyn/protoc-gen-ts
其他外链3 条
- docs.konghq.com/hub/kong-inc/grpc-webdocs.konghq.com/hub/kong-inc/grpc-web
- nginx.org/en/docs/http/ngx_http_grpc_module.htmlnginx.org/en/docs/http/ngx_http_grpc_module.html
- www.nginx.com/blog/nginx-1-13-10-grpcwww.nginx.com/blog/nginx-1-13-10-grpc