Getting client's MAC address on node.js

Jorge Ramón picture Jorge Ramón · Oct 29, 2013 · Viewed 24.1k times · Source

Is there a way to find client's mac address on Node.js? I have been searching about it and i found node-sigar project but it didn't works because it throws a "cannot find module ./build/Release/sigar" error.

Answer

WiredPrairie picture WiredPrairie · Oct 29, 2013

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.