Accessing Service URL from Server Side

57 views
Skip to first unread message

Robert Hardisty

unread,
Jul 17, 2023, 11:16:23 PM7/17/23
to grpc.io
Hi all,

For security purposes, we are needing to know the initial service URL the client sent (e.g. https://my-grpc-server-external.com/some-method). We plan to have an internal and external load balancer with different DNS, and need a way extract that on the server side. I thought the context object in the server's method would have it, but unable to find it. I also thought the grpc.AuthMetadataContext might have it, but that looks like a client-side property.

Any help is appreciated.

Best,
Bob

Xuan Wang

unread,
Oct 11, 2023, 1:38:02 PM10/11/23
to grpc.io
Hi, you should be able to send the service URL using metadata, we have some examples here: https://github.com/grpc/grpc/tree/master/examples/python/metadata.

Best,
Xuan

Reply all
Reply to author
Forward
0 new messages