Can connectrpc work with go grpc middlewares? #686
-
Hi everyone, I am wondering whether connectrpc server can work with existing Go grpc middlewares, like the one you find in this repository. I didn't see any mentions of this interoperability in the docs, so I'd appreciate it if someone can confirm this information. Thank you in advanced for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@tuananhlai, no I'm afraid it does not. But it does, on the other hand work with regular "net/http" middleware. So many common functions, like authn|z, rate limiting, etc can still easily be integrated with Connect as there a "net/http"-based middleware libraries for these. One thing that can be done to keep using the gRPC libraries, including this middleware, is to continue using the grpc-go module for your server implementation, but use vanguard-go as middleware in front of that. That allows your gRPC server to accept traffic in the Connect protocol, so you can use Connect from web and mobile clients without having to migrate server code to the connect-go server library. |
Beta Was this translation helpful? Give feedback.
@tuananhlai, no I'm afraid it does not. But it does, on the other hand work with regular "net/http" middleware. So many common functions, like authn|z, rate limiting, etc can still easily be integrated with Connect as there a "net/http"-based middleware libraries for these.
One thing that can be done to keep using the gRPC libraries, including this middleware, is to continue using the grpc-go module for your server implementation, but use vanguard-go as middleware in front of that. That allows your gRPC server to accept traffic in the Connect protocol, so you can use Connect from web and mobile clients without having to migrate server code to the connect-go server library.