0

Following this (I think accurately): https://www.envoyproxy.io/docs/envoy/latest/configuration/http_filters/grpc_json_transcoder_filter

I'm following the configuration in the documentation and my gRPC service is on :50051 and the gRPC-JSON Transcoder is listening on :51051.

I'm able to submit gRPC requests against the transcoder:

grpcurl \
--plaintext \
--import-path=${HELLOWORLD} \
--import-path=${GOOGLEAPIS} \
--proto=helloworld/helloworld.proto \
-d '{"name":"Freddie"}' \
:51051 \
helloworld.Greeter/SayHello
{
  "message": "Hello Freddie"
}

But I'm unable to determine how to correctly submit REST requests to it:

curl \
--request GET \
--header "Content-Type: application/json" \
--data '{"name":"Freddie"}' \
http://0.0.0.0:51051/helloworld.Greeter/SayHello

curl \
--header "Content-Type: application/json" \
--data '{"name":"Freddie"}' \
http://0.0.0.0:51051/say

curl \
--request GET \
--header "Content-Type: application/json" \
http://0.0.0.0:51051/say?name=Freddie

I've tried with|without headers, with --insecure and https, using --request POST and --request GET all with no success.

All result in:

upstream connect error or disconnect/reset before headers. reset reason: remote reset

Would appreciate guidance on debugging this type of issue too. Envoy logs nothing to stdout correponding to these requests and the admin console includes no (obvious) explanation either.

Thanks!

DazWilkin
  • 32,823
  • 5
  • 47
  • 88

1 Answers1

0

Hmmm... I repro'd the solution on a different machine and it works:

Working variants:

curl \
--header "Content-Type: application/json" \
http://localhost:51051/say?name=Frederik
{
 "message": "Hello Frederik"
}

curl http://localhost:51051/say?name=Frederik
{
 "message": "Hello Frederik"
}

Non-working (incorrect) variants:

curl \
--header "Content-Type: application/grpc" \
http://localhost:51051/say

curl \
--data '{"name":"Henry"}' \
http://localhost:51051/say
upstream connect error or disconnect/reset before headers. reset reason: remote reset
DazWilkin
  • 32,823
  • 5
  • 47
  • 88