Replies: 3 comments
-
The challenge here is to forward a |
Beta Was this translation helpful? Give feedback.
0 replies
-
@yotamofek because of your work on #713, do you have any input here? |
Beta Was this translation helpful? Give feedback.
0 replies
-
The solution is to write an interceptor struct, like in this example. struct MyAuthorizer {
authorization: MetadataValue<Ascii>,
}
impl Interceptor for MyAuthorizer {
fn call(&mut self, mut req: Request<()>) -> Result<Request<()>, Status> {
req.metadata_mut().insert("authorization", self.authorization.clone());
Ok(req)
}
}
let authorization = req.metadata().get("authorization").clone().unwrap().clone();
let authorizer = MyAuthorizer { authorization };
let mut my_client = MyClient::with_interceptor(channel.clone(), authorizer); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have a Python gRPC service that I want to proxy using tonic. I've seen this post: #1111 but I haven't been able to figure out how I can extend it to reverse proxy the request to another service.
Specifically I'd like to use tonic-web to add grpc web support for my Python grpc service. I know there's other software that can do this but we already have a rust service and it'd be nice not to introduce another component. Does anyone have experience with this?
Beta Was this translation helpful? Give feedback.
All reactions