tmc / grpc-websocket-proxy

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

Probably a mistake in example #26

Open dnovikoff opened 3 years ago

dnovikoff commented 3 years ago

Probably the example service should be.

service EchoService {
  rpc Echo(stream EchoRequest) returns (stream EchoResponse) {
    option (google.api.http) = {get: "/echo"};
  }
  rpc Stream(Empty) returns (stream EchoResponse) {
    option (google.api.http) = {get: "/stream"};
  }
  rpc Heartbeats(stream Empty) returns (stream Heartbeat) {
    option (google.api.http) = {post: "/heartbeats"};
  }
}

Because now both Echo and Stream methods points to the same /echo location. Also the echo should probably be get not post based on what i have tested with JS example.

I could have make a PR, but I don't know which versions you use to generate.

tmc commented 2 years ago

@dnovikoff thanks for pointing this out -- I'm happy to accept a modernization of the codegen here to use buf to make the output more stable -- is that something you'd be open to helping with?