apache / apisix-go-plugin-runner

Go Plugin Runner for APISIX
https://apisix.apache.org/
Apache License 2.0
173 stars 68 forks source link

request help: How to get right body from grpc? #121

Open BERZERKCOOLeST opened 1 year ago

BERZERKCOOLeST commented 1 year ago

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?

An-DJ commented 1 year ago

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

BERZERKCOOLeST commented 1 year ago

@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.