Looking for an alternative to whatismyip.org (which is not reachable, at least from here)...
sf::IPAddress __getIpFromCheckipdyndns_org()
{
IPAddress PublicAddress;
Http Server("http://checkip.dyndns.org");
Http::Request Request(Http::Request::Get, "/");
Http::Response Page = Server.SendRequest(Request,4.f);
if(Page.GetStatus() == Http::Response::Ok)
{
string s = Page.GetBody();
size_t ind = s.find_first_of("0123456789");
if(ind != string::npos)
{
size_t indl = s.find_first_not_of("0123456789.",ind);
string sub = s.substr(ind,indl-ind);
if(sub.length() >= 7 && sub.length() <= 15)
{
PublicAddress = sub;
}
}
}
return PublicAddress;
}
Any idea why it is not working (the page is reachable in my Browser), but immediately returning an empty page??