Running sample "http client.c" to access Localhost 127.0.0.1 -- question

Hi
I am using the provided “http client.c” Dyn C sample program to study web page access and headers. It works fine when I provide a name (google.com) or an IP address x.z.y.a.

However when I try to access a locally (Win 7 PC) running Apache web server (XAMPP) the program times out with an obscure error, see below. I am entering the URL = 127.0.0.1/phpsampletest/index.php. This works from any local web browser but not from when I enter the same address into the http client.c demo pgm. Any ideas as to why?

Thanks! Al

-----------------returned message when running “http client.c”

Retrieving [127.0.0.1/phpsampletest/index.php]…
HTTPC: using scheme ‘’
httpc_get: opening socket
HTTPC: Resolving 127.0.0.1
HTTPC: Opening IP=7F000001 port=80 iface=0xff
HTTPC: unexpected error (rem=1), aborting connection
HTTPC: unexpected error (rem=1), aborting connection
error -405 calling httpc_get_url()

Enter URL (blank to exit):

127.0.0.1 is the local loop back address which in the case of the PC refers to the server on the PC, in the case of the Rabbit device it would be used to access a web server running on the Rabbit device.
To access the web server on the PC from the Rabbit device you need to use the PCs IP address in the client demo program.

Regards,
Peter

Peter
That makes perfect sense! I will try the idea and am sure you are correct. Really appreciate the excellent advice. Once I read it, it seemed obvious :slight_smile:

Al