Sai*_*Sai 1 javascript node.js express
我正在尝试从传入的请求对象中获取 MAC 地址。我的应用程序在 nginx 代理后面运行,因此为了获取 IP 地址,我使用以下语法并且它工作正常。
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
Run Code Online (Sandbox Code Playgroud)
同样,有没有一种方法可以获取已发出请求的 MAC 地址。遇到了这个包https://www.npmjs.com/package/getmac,我不确定这是否有帮助。从根本上说,我需要获取每个传入请求的 MAC 和 IP 地址。
这是不可能的。MAC 地址不通过 Internet 传输。
请参阅:https : //superuser.com/questions/510920/is-my-mac-address-public-when-browsing-the-internet或https://security.stackexchange.com/questions/36583/can-a- website-still-detect-my-real-mac-address-even-if-i-use-different-virtual-m
(并且getmac只会为您提供服务器网络接口的 MAC 。)
| 归档时间: |
|
| 查看次数: |
11315 次 |
| 最近记录: |