GoogleCloudPlatform / cloud-run-proxy

Local proxy for authenticating requests to Cloud Run
Apache License 2.0
124 stars 20 forks source link

Can it support grpc or http2 services on cloud run as well? #22

Closed liufuyang closed 1 year ago

liufuyang commented 1 year ago

Thanks for creating the nice proxy here.

However, I seem to have some difficult to make it work with a grpc service running in cloud run.

So for example this works:

grpcurl -H "Authorization: Bearer $(gcloud auth print-identity-token)" xxx.a.run.app:443 list

xxx.Service

And if I run the proxy with:

cloud-run-proxy -host https://xxx.a.run.app -token $(gcloud auth print-identity-token)  -bind "0.0.0.0:8066"
http://0.0.0.0:8066 proxies to https://xxx.a.run.app

or

gcloud beta run services proxy xxx  --project xxx --region europe-west1 --port=8066

Then try talk to it gives timeout:

grpcurl --plaintext localhost:8066 list
Failed to dial target host "localhost:8066": context deadline exceeded
liufuyang commented 1 year ago

@sethvargo @DKbyo

Thanks for addressing it. But has it been really solved? 🤔

I did:

go install github.com/GoogleCloudPlatform/cloud-run-proxy@main
go: downloading github.com/GoogleCloudPlatform/cloud-run-proxy v0.3.1-0.20230522194721-829abff5b178

then run the commands above, still having the same issue.

DKbyo commented 1 year ago

@liufuyang You might need to use the new flag -http2

liufuyang commented 1 year ago

Oh right... indeed, forget about that part. Thanks, it looks like working pretty nicely :)