gPPC 调试工具(for go)

Table of Contents

1. grpcurl


Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers


Failed to dial target host "localhost:1234": tls: first record does not look like a TLS handshake

加上 -plaintext 即可。


Failed to list services: server does not support the reflection API

需要在项目中注册 reflection


  • 查看 RPC 服务: grpcurl -plaintext list
  • 查看 RPC 接口: grpcurl -plaintext list <service_name>
  • 描述定义: grpcurl -plaintext list <message/rpc-interface>
  • 调用方法: grpcurl -plaintext -d '{json_body}' <rpc-interface> 比如: grpcurl -plaintext -d '{"type": "1"}' libproto.EventRPC.ListEvents -d 后面加上 @ 支持从标准输入中读取流参数。
  • 添加 metadata -H 'key:value'

First created: 2020-05-26 11:30:02
Last updated: 2022-12-11 Sun 12:49
Power by Emacs 27.1 (Org mode 9.4.4)