Check Public IP Address.
Open web browser.
From terminal, you can use curl.
$ curl -L checkip.junian.dev
203.0.113.113Integrate with code, example in C#:
public string GetPublicIPAddress()
{
var uri = "https://checkip.junian.dev/";
var ip = string.Empty;
using (var client = new HttpClient())
{
ip = client?.GetAsync(uri)?.Result?.Content?
.ReadAsStringAsync()?.Result?.Trim();
}
return ip;
}Install dependencies.
npm installRun in local machine.
npm run devDeploy to Cloudflare Worker.
npm run deploy