Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Alternative to whatismyip.org  (Read 33417 times)

0 Members and 2 Guests are viewing this topic.

zac

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Alternative to whatismyip.org
« on: January 18, 2009, 03:55:06 pm »
Looking for an alternative to whatismyip.org (which is not reachable, at least from here)...
Code: [Select]

     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??

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Alternative to whatismyip.org
« Reply #1 on: January 18, 2009, 07:02:23 pm »
Your code works perfectly on my machine.
Laurent Gomila - SFML developer

Core Xii

  • Jr. Member
  • **
  • Posts: 54
    • MSN Messenger - corexii@gmail.com
    • AOL Instant Messenger - Core+Xii
    • View Profile
Alternative to whatismyip.org
« Reply #2 on: January 18, 2009, 11:26:10 pm »
http://www.dyndns.com/developers/checkip.html

Quote
Checks must be spaced 10 minutes apart to help reduce server load

Sure you conformed to this?

zac

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Alternative to whatismyip.org
« Reply #3 on: January 20, 2009, 07:08:29 pm »
Thats not that good... ;)
Okay. It is no possible alternative, I think ;)

We have to find another way - whatismyip.org still does not respond. (It least I get stuck on creating a connection).

Core Xii

  • Jr. Member
  • **
  • Posts: 54
    • MSN Messenger - corexii@gmail.com
    • AOL Instant Messenger - Core+Xii
    • View Profile
Alternative to whatismyip.org
« Reply #4 on: January 20, 2009, 11:02:25 pm »
Finding your IP is as simple as connecting to any host that is configured to reply with your remote IP. It's easy to set up your own host to do this, the only requirement is a static IP or DNS so the clients know where to connect.

For instance if you have a web server with PHP, it's as easy as
Code: [Select]
<?php echo $_SERVER['REMOTE_ADDR'&#93;; ?>

In fact, I just did that in 3 minutes: http://corexii.com/ip/

You can use that for development if you can't make your own; However, do not use it for a public distribution, I don't know if I can cope with the traffic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Alternative to whatismyip.org
« Reply #5 on: January 20, 2009, 11:35:45 pm »
The server www.whatismyip.org is currently unreachable, and it is indeed very simple to make a webpage return an IP address, so I added one on the SFML website and added it as a fallback in IPAddress::GetPublicAddress :)
Laurent Gomila - SFML developer

zac

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Alternative to whatismyip.org
« Reply #6 on: January 20, 2009, 11:39:18 pm »
Okay, great :).

dewyatt

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://dewyatt.blogspot.com
Alternative to whatismyip.org
« Reply #7 on: January 25, 2009, 10:57:15 am »
I just thought I'd add another alternative in case anyone needs one:
http://www.showmyip.com/simple

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Alternative to whatismyip.org
« Reply #8 on: January 25, 2009, 04:29:44 pm »
www.whatismyip.com is the one i always go... he is table since many year...

http://whatismyip.com/automation/n09230945.asp
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.