Get the Client IP on a GRPC C++ server

569 views
Skip to first unread message

Anirudh Kasturi

unread,
Jul 17, 2017, 3:51:31 PM7/17/17
to grpc.io
I am trying to figure how I can get the Client's IP address when the client sends a request to my GRPC server written in C++.  Does anyone know if the Client IP is exposed anywhere?  Thank you.

Evan Jones

unread,
Jul 17, 2017, 5:41:04 PM7/17/17
to grpc.io
It is available via grpc::ServerContext::peer():


Hope that helps!

Evan

Anirudh Kasturi

unread,
Jul 17, 2017, 5:46:58 PM7/17/17
to grpc.io
Thank you Evan ! I will try it out.  

Best,
Anirudh
Reply all
Reply to author
Forward
0 new messages