If would like to find out the client IP address you need to call thirdparty api. Some thirdparty api provide api. I would like to use cludflare api to findout IP address. See the bellow example -
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", 'https://www.cloudflare.com/cdn-cgi/trace', false);
xmlHttp.send(null);
let data = xmlHttp.responseText;
data = data.trim().split('\n').reduce(function(obj, pair) {
pair = pair.split('=');
return obj[pair[0]] = pair[1],
obj;
}, {});
console.log(data) ;
Output -
{
}