My IP:
If you need to quickly obtain external(public) IP address, which your device uses to send requests from, then simply follow this link: https://sysopnotes.net/myip
Response is in JSON format: {«ip»:»11.12.13.14″}
Request could be performed from browser, as well as using CURL or another HTTP-client.
CURL:
curl https://sysopnotes.net/myip
JavaScript:
fetch('https://sysopnotes.net/myip')
.then(response => response.json())
.then(data => alert(data.ip) );
PHP:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://sysopnotes.net/myip");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo json_decode($output, true)['ip'];