有没有办法在 Node.js 上找到客户端的 mac 地址?我一直在搜索它,我找到了 node-sigar 项目,但它没有工作,因为它抛出“找不到模块 ./build/Release/sigar”错误。
问问题
26703 次
2 回答
12
Unless your code is running on the same LAN segment as the client, you cannot obtain the MAC address of a client. You'd need to likely shell out to a command line tool or native support to gain addresses on the local LAN segment.
For nodejs: https://npmjs.org/search?q=Arp
If you try to get remote clients' MAC addresses, you'll end up with the address of a router more than likely.
于 2013-10-29T02:31:02.833 回答
-3
getmac模块将执行此操作。它调用命令行以获取系统的网络配置信息,然后使用正则表达式解析输出以查找 mac 地址。它使用的系统命令是getmac
(Windows)或ifconfig
(其他平台)。
于 2014-03-04T13:54:21.800 回答