【发布时间】:2019-11-15 12:23:56
【问题描述】:
如何通过onCall Firebase 函数访问用户 IP 地址...
exports.MyFunction = functions.https.onCall((data, context) => {
var IPAddress; //???
console.log(IPAddress)
});
我看到我可以使用context.rawRequest.connection.remoteAddress 获取 IP 地址,但后来我看到this post 关于http 函数,我不知道如何在onCall 函数上设置标题到fastly-client-ip。
有什么建议吗?
【问题讨论】:
-
您找到解决方案了吗?
标签: node.js firebase google-cloud-functions ip-address