nachshon f
nachshon f

Reputation: 3680

Get users IP address from Firebase Callable function

How can I access the users IP address from an onCall Firebase function...

exports.MyFunction = functions.https.onCall((data, context) => {
   var IPAddress; //???
   console.log(IPAddress)
});

I saw that I might be able to get the IP address with context.rawRequest.connection.remoteAddress but then I saw this post regarding an http function, and I'm not sure how to set the headers on an onCall function to fastly-client-ip.

Any suggestions?

Upvotes: 7

Views: 3119

Answers (1)

Related Questions