apisix-go-plugin-runner icon indicating copy to clipboard operation
apisix-go-plugin-runner copied to clipboard

request help: How to get right body from grpc?

Open BERZERKCOOLeST opened this issue 2 years ago • 2 comments

Issue description

r.Body() gets right body from http request, but gets strange body which seems to be interceptive, when request is from grpc. Need to get the payload from grpc request to do something. Does it support?

  • APISIX Go Plugin Runner's version: 4.0
  • APISIX version: 2.13.2
  • Go version: 1.18

BERZERKCOOLeST avatar Dec 13 '22 09:12 BERZERKCOOLeST

@BERZERKCOOLeST Could you plz give the steps to reproduce the problem you met?

An-DJ avatar Jan 06 '23 01:01 An-DJ

@BERZERKCOOLeST Could you plz give the steps to reproduce the problem you met?

  1. Set a route in APISIX dashboard. Set a upstream for the route and the scheme of upstream is grpc(need to implement a simple grpc service as upstream). And set plugin for it;
  2. Send a request with payload using a grpc cli. Try to use r.Body() in plugin to get the payload, but failed, it got a messy payload.

BERZERKCOOLeST avatar Jan 06 '23 02:01 BERZERKCOOLeST