Earlier I used below code to get the client IP on express.js
req.headers['x-forwarded-for'] ||
req.connection.remoteAddress ||
req.socket.remoteAddress ||
req.connection.socket.remoteAddress
would like to know what is the way to get IP of client with grpc node application. I tried getPeer() which gives always ipv4:127.0.0.1:33944 even when API call is from outside.
Does something equivalent to below go code work?
call.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR).toString();