Skip to content

Instantly share code, notes, and snippets.

@hectorguo
hectorguo / getLocalIP.js
Last active March 9, 2026 12:13
Get local IP address through Javascript
/**
* Get Local IP Address
*
* @returns Promise Object
*
* getLocalIP().then((ipAddr) => {
* console.log(ipAddr); // 192.168.0.122
* });
*/
function getLocalIP() {