tmc / grpc-websocket-proxy

A proxy to transparently upgrade grpc-gateway streaming endpoints to use websockets
MIT License
553 stars 72 forks source link

Doesn't work with grpc-gateway/v2/runtime #27

Open flymedllva opened 3 years ago

flymedllva commented 3 years ago

Doesn't work with grpc-gateway/v2/runtime

I was unable to start with v2. Is there an example of the work?

The connection attempt ends

{
   "code": 12,
   "message": "Method Not Allowed",
   "details": []
}   
tmc commented 2 years ago

@FlymeDllVa You must override the underlying http method for the proxied request with something like method=POST.

For example:ws://localhost:50001/fooservice.v1.GameServerService/SyncState?method=POST

tmc commented 2 years ago

Arguably this library should do that automatically because I believe all streaming grpc-gateway endpoints only accept POST.

hxtk commented 3 months ago

Arguably this library should do that automatically because I believe all streaming grpc-gateway endpoints only accept POST.

https://github.com/googleapis/googleapis/blob/46bc6f2d612c42644f061b4c22eedd762cd72909/google/watcher/v1/watch.proto#L168

Google's published gRPC APIs contain at least one example of a streaming endpoint being mapped to GET.