0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

curl で gRPC の疎通確認をしたい

Posted at

実行コマンド

printf '\x00\x00\x00\x00\x00' |
  curl \
    -v -s --http2 \
    --data-binary @- \
    --output - \
    -H "Content-Type: application/grpc" \
    -H "TE: trailers" \
    "${GRPC_ENDPOINT:?}/grpc.health.v1.Health/Check" |
  hexdump -C 

空のメッセージを /grpc.health.v1.Health/Check 宛に送ってあげれば良い。

実行例

  • リクエスト: 00 00 00 00 00
    • 最初の 1 バイト 00 は圧縮フラグ(0 = 非圧縮)
    • 次の 4 バイト 00 00 00 00 はメッセージ長(0バイト)
$ printf '\x00\x00\x00\x00\x00' | curl -v -s --http2 -H "Content-Type: application/grpc" -H "TE: trailers" --data-binary @- --output - "${GRPC_ENDPOINT:?}/grpc.health.v1.Health/Check" | hexdump -C 
... 略 ...
00000000  00 00 00 00 02 08 01                              |.......|
00000007
  • レスポンス 00 00 00 00 02 08 01
    • 最初の5バイト 00 00 00 00 02
      • 最初の 1 バイト 00 は圧縮フラグ(0 = 非圧縮)
      • 次の 4 バイト 00 00 00 02 はメッセージ長(2バイト)
    • 残りの2バイト 08 01
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?