我有一个写在 node.js 上的 Azure 函数。如何检索调用该函数的客户端的 IP 地址?
到目前为止我发现了什么:
可以从标题中读取它:
module.exports = function (context, req) { var ip = req.headers['x-forwarded-for'] }
以这种方式获取 ip 是否可靠,因为它可以在通往函数的途中轻松更改?
azure node.js azure-functions
azure ×1
azure-functions ×1
node.js ×1