Esk*_*dar 6 azure node.js azure-functions
我有一个写在 node.js 上的 Azure 函数。如何检索调用该函数的客户端的 IP 地址?
到目前为止我发现了什么:
可以从标题中读取它:
module.exports = function (context, req) {
var ip = req.headers['x-forwarded-for']
}
Run Code Online (Sandbox Code Playgroud)以这种方式获取 ip 是否可靠,因为它可以在通往函数的途中轻松更改?
| 归档时间: |
|
| 查看次数: |
2410 次 |
| 最近记录: |