Networking Forums

Networking Forums > Computer Networking > Linux Networking > network connection to http

Reply
Thread Tools Display Modes

network connection to http

 
 
mohi
Guest
Posts: n/a

 
      11-09-2008, 07:00 AM
hello everyone,

i have a problem regarding networking apis of unix link systems ....i
don know this is the best place this
request but i cudnt get one .(so also suggest where to ask such
questions)

the problem is that after finally connecting to the server when
i just tried to GET the image -i show u inputs that are taken by my
program

enter the server ip address : 10.10.19.222

enter the port at which to connect to the server : 9029

sucessfully connected to the server

enter the url to request(without spaces) :http://10.10.19.222:9029/
home/Mohan/mine/web/images/tech.jpg

reading frm the server......

now after this the output from the server is saved in a file which has
contents like

HTTP/1.1 200 OK^M
Date: Sun, 09 Nov 2008 06:36:32 GMT^M
Server: Apache/2.2.6 (Fedora)^M
Last-Modified: Fri, 07 Nov 2008 12:27:31 GMT^M
ETag: "1780314-1533e9-897f32c0"^M
Accept-Ranges: bytes^M
Content-Length: 1389545^M
Connection: close^M
Content-Type: image/jpeg^M
X-Pad: avoid browser bug^M
^M
=FF=D8=FF=E1<90>
ExifRL failed: 6
2009-09-26 22:31:06, Fetching URL failed: 6
h1>Moved Permanently</h1>
<p>The document has moved <a href=3D"http://10.10.19.222:9029/home/
Mohan/">here</a>.</p>
<hr>
<address>Apache/2.2.6 (Fedora) Server at 10.10.19.222 Port 9029</
address>
</body></html>
~

but when i try to view this from the browser with exactly the same url
i have the image .....what can be wrong....

where is the problem in the system (server ,code ,write() ,etc)
the server is apache running on my local machine .
i use fedora8(linux)
thanks a lot
Mohan

 
Reply With Quote
 
 
 
 
Cacadril
Guest
Posts: n/a

 
      11-09-2008, 06:09 PM
On Nov 9, 9:00*am, mohi <mohangupt...@gmail.com> wrote:
> hello everyone,
>

[snip]
> *enter the url to request(without spaces) :http://10.10.19.222:9029/
> home/Mohan/mine/web/images/tech.jpg


You have already specified the IP and the port number in response to
earlier prompts.
Is your program using all of this answer in the GET request? I believe
that would be wrong. Your program should send

GET /home/Mohan/mine/web/images/tech.jpg

not

GET http:/10.10.19.222:9029/home/Mohan/mine/web/images/tech.jpg

You could try to install and run wireshark to see exactly what the
exchanges look like when you use the browser, and compare when you use
your program.

Regards
 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      11-09-2008, 10:50 PM
On Nov 9, 12:00*am, mohi <mohangupt...@gmail.com> wrote:
> hello everyone,
>
> i have a problem regarding networking apis of unix link systems ....i
> don know this is the best place this
> request but i cudnt get one .(so also suggest where to ask such
> questions)
>
> the problem is that after finally connecting to the server when
> i just tried to GET the image -i show u inputs that are taken by my
> program
>
> enter the server ip address : 10.10.19.222
>
> *enter the port at which to connect to the server : 9029
>
> *sucessfully connected to the server
>
> *enter the url to request(without spaces) :http://10.10.19.222:9029/
> home/Mohan/mine/web/images/tech.jpg
>
> *reading frm the server......
>
> now after this the output from the server is saved in a file which has
> contents like
>
> HTTP/1.1 200 OK^M
> Date: Sun, 09 Nov 2008 06:36:32 GMT^M
> Server: Apache/2.2.6 (Fedora)^M
> Last-Modified: Fri, 07 Nov 2008 12:27:31 GMT^M
> ETag: "1780314-1533e9-897f32c0"^M
> Accept-Ranges: bytes^M
> Content-Length: 1389545^M
> Connection: close^M
> Content-Type: image/jpeg^M
> X-Pad: avoid browser bug^M
> ^M
> =FF=D8=FF=E1<90>
> ExifRL failed: 6
> 2009-09-26 22:31:06, Fetching URL failed: 6
> h1>Moved Permanently</h1>
> <p>The document has moved <a href=3D"http://10.10.19.222:9029/home/
> Mohan/">here</a>.</p>
> <hr>
> <address>Apache/2.2.6 (Fedora) Server at 10.10.19.222 Port 9029</
> address>
> </body></html>
> ~
>
> but when i try to view this from the browser with exactly the same url
> i have the image .....what can be wrong....
>
> where is the problem in the system (server ,code ,write() ,etc)
> the server is apache running on my local machine .
> i use fedora8(linux)
> thanks a lot
> Mohan


You are using two different programs to do two different things, so
it's not surprising that you are getting different results. First, you
are simply retrieving the contents of a particular URL without any
processing or analysis. Then you are using a browser to retrieve the
contents that that URL leads to, whether or not the contents are
returned by requesting that URL.

Two different processes, two different results.

If you wan the result a browser will get, you have to act like a
browser. It doesn't just retrieve contents, it analyzes and acts on
them.

DS
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any http proxy to accelerate http GET method? Trent.Zhou@gmail.com Linux Networking 7 11-23-2007 05:16 AM
forward http://p2p.mydomain.com to http://mydomainIP:50001/gui/index.html, is that possible? aticatac Network Routers 1 11-13-2007 12:00 AM
Ftp / Http connection Linda Windows Networking 1 10-04-2006 01:33 AM
Apache problem: Can see http://localhost/ but not http://ipaddress/ Andrew Linux Networking 4 02-13-2005 12:26 PM
Free Broadband Comedy Channel http://Yuks.TV Groucho, Benny, Chaplin, Marilyn, more http://Yuks.TV Broadband Hardware 0 01-15-2005 04:57 PM



1 2 3 4 5 6 7 8 9 10 11