Networking Forums

Networking Forums > Computer Networking > Linux Networking > http server protocol

Reply
Thread Tools Display Modes

http server protocol

 
 
Garrick
Guest
Posts: n/a

 
      10-28-2006, 10:34 PM
This isn't specifically a Linux networking question, but I hope somebody
will help because this is a device that will be used with Linux.

I am using a ethernet embedded module
(SocketEthernetIP)(http://www.multitech.com/PRODUCTS/Fa...SocketEthernet
IP/
in raw TCP/IP mode as part of a embedded webserver for a product that will
access the Internet.

The ethernet side of SocketEthernetIP is set it up to have an open TCP port
(3000), and is connected to the LAN, 192.168.0.123

I have Windows Hyperterminal serial terminal connected to the serial port
side of the SocketEthernetIP.

On my client PC, in the webbrowser I contact it http://192.168.0.123:3000


The browser GET command is received by SocketEthernetIP, as it appears in
the output of the serial port which is connected to the serial terminal.
When SocketEthernetIP recieves the HTTP GET request, it assignes a socket
handle which is associated with the socket of the web browser.

Using the serial terminal, I send an HTTP reply to the client web browser,
using the socket handle, the reply:

HTTP/1.1 200 OK
Content-type: text/html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>test</title>
</head>
<body>
test
</body>
</html>

SocketEthernetIP module wraps it into the TCP packet and sends it to my
webbrowser over the LAN, but it the web browser doesn't seem to get it, it
is still waiting for a response. I tried using a packet sniffer IE Inspector
which show the sent HTTP actually is being received by the PC, and it is
associated with the correct socket destination.

But the web browser doesn't acknowledge it. I tried closing the all TCP
sockets from SocketEthernetIP, but that didn't cause the browser to load the
sent HTTP response.

Is there something I am not doing here?

Thanks.



 
Reply With Quote
 
 
 
 
Garrick
Guest
Posts: n/a

 
      10-29-2006, 05:50 AM
UPDATE: The terminal was not sending the line-feeds with the carriage
returns. With that turned on and fixed, I send the following text to the
browser, flush the socket and I have to close it in order for the browser to
display, but it then displays everything raw:

HTTP/1.1 200 OKContent-type: text/html
<html><head> <meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>test</title></head><body>test</body></html>
Someone told me that the TCP connection was probably expecting an End of
Data signal, which I don't know how to send.

Garrick

"Garrick" <(E-Mail Removed)> wrote in message
news:J-(E-Mail Removed)...
> This isn't specifically a Linux networking question, but I hope somebody
> will help because this is a device that will be used with Linux.
>
> I am using a ethernet embedded module
>

(SocketEthernetIP)(http://www.multitech.com/PRODUCTS/Fa...SocketEthernet
> IP/
> in raw TCP/IP mode as part of a embedded webserver for a product that will
> access the Internet.
>
> The ethernet side of SocketEthernetIP is set it up to have an open TCP

port
> (3000), and is connected to the LAN, 192.168.0.123
>
> I have Windows Hyperterminal serial terminal connected to the serial port
> side of the SocketEthernetIP.
>
> On my client PC, in the webbrowser I contact it http://192.168.0.123:3000
>
>
> The browser GET command is received by SocketEthernetIP, as it appears in
> the output of the serial port which is connected to the serial terminal.
> When SocketEthernetIP recieves the HTTP GET request, it assignes a socket
> handle which is associated with the socket of the web browser.
>
> Using the serial terminal, I send an HTTP reply to the client web browser,
> using the socket handle, the reply:
>
> HTTP/1.1 200 OK
> Content-type: text/html
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
> <title>test</title>
> </head>
> <body>
> test
> </body>
> </html>
>
> SocketEthernetIP module wraps it into the TCP packet and sends it to my
> webbrowser over the LAN, but it the web browser doesn't seem to get it, it
> is still waiting for a response. I tried using a packet sniffer IE

Inspector
> which show the sent HTTP actually is being received by the PC, and it is
> associated with the correct socket destination.
>
> But the web browser doesn't acknowledge it. I tried closing the all TCP
> sockets from SocketEthernetIP, but that didn't cause the browser to load

the
> sent HTTP response.
>
> Is there something I am not doing here?
>
> Thanks.
>
>
>



 
Reply With Quote
 
Garrick
Guest
Posts: n/a

 
      10-29-2006, 09:23 AM
Using IP Sniffer http://erwan.l.free.fr/ I found the Windows Hyperterminal
serial terminal was converting CR/LF to CR only. The browser needs CR/LF
pairs in the HTML data or it ignores it. So I set HyperTerminal to send
CR/LF pairs, but my browser received and displayed raw HTML. I then found a
single LF character was appearing before the HTML header "HTTP/1.1 200 OK"
in the reply data sent to the client browser.

The final solution is to turn on or off CR/LF in HyperTerminal depending on
whether I am typing commands to SocketEthernetIP or pasting the HTML data
into HyperTerminal. The problem was caused by the serial terminal software.

"Garrick" <(E-Mail Removed)> wrote in message
news:4MidnV0X_LHG09nYnZ2dnUVZ_r2dnZ2d@scnresearch. com...
> UPDATE: The terminal was not sending the line-feeds with the carriage
> returns. With that turned on and fixed, I send the following text to the
> browser, flush the socket and I have to close it in order for the browser

to
> display, but it then displays everything raw:
>
> HTTP/1.1 200 OKContent-type: text/html
> <html><head> <meta content="text/html; charset=ISO-8859-1"
> http-equiv="content-type">
> <title>test</title></head><body>test</body></html>
> Someone told me that the TCP connection was probably expecting an End of
> Data signal, which I don't know how to send.
>
> Garrick
>
> "Garrick" <(E-Mail Removed)> wrote in message
> news:J-(E-Mail Removed)...
> > This isn't specifically a Linux networking question, but I hope somebody
> > will help because this is a device that will be used with Linux.
> >
> > I am using a ethernet embedded module
> >

>

(SocketEthernetIP)(http://www.multitech.com/PRODUCTS/Fa...SocketEthernet
> > IP/
> > in raw TCP/IP mode as part of a embedded webserver for a product that

will
> > access the Internet.
> >
> > The ethernet side of SocketEthernetIP is set it up to have an open TCP

> port
> > (3000), and is connected to the LAN, 192.168.0.123
> >
> > I have Windows Hyperterminal serial terminal connected to the serial

port
> > side of the SocketEthernetIP.
> >
> > On my client PC, in the webbrowser I contact it

http://192.168.0.123:3000
> >
> >
> > The browser GET command is received by SocketEthernetIP, as it appears

in
> > the output of the serial port which is connected to the serial terminal.
> > When SocketEthernetIP recieves the HTTP GET request, it assignes a

socket
> > handle which is associated with the socket of the web browser.
> >
> > Using the serial terminal, I send an HTTP reply to the client web

browser,
> > using the socket handle, the reply:
> >
> > HTTP/1.1 200 OK
> > Content-type: text/html
> >
> > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> > <html>
> > <head>
> > <meta content="text/html; charset=ISO-8859-1"

http-equiv="content-type">
> > <title>test</title>
> > </head>
> > <body>
> > test
> > </body>
> > </html>
> >
> > SocketEthernetIP module wraps it into the TCP packet and sends it to my
> > webbrowser over the LAN, but it the web browser doesn't seem to get it,

it
> > is still waiting for a response. I tried using a packet sniffer IE

> Inspector
> > which show the sent HTTP actually is being received by the PC, and it is
> > associated with the correct socket destination.
> >
> > But the web browser doesn't acknowledge it. I tried closing the all TCP
> > sockets from SocketEthernetIP, but that didn't cause the browser to load

> the
> > sent HTTP response.
> >
> > Is there something I am not doing here?
> >
> > Thanks.
> >
> >
> >

>
>



 
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
Error: Protocol Not Valid for HTTP. Might Be Because Port Number IsOut of Range. pbd22 Windows Networking 6 04-24-2009 07:21 PM
Only 2 Http Concurrent Connections, Server to Server, .NET Jay Douglas Windows Networking 1 04-27-2007 10:46 PM
linux socket programming and HTTP Protocol Problem PGHULME Linux Networking 1 08-21-2006 09:35 PM
http server RosalieM Linux Networking 9 06-25-2004 09:31 AM
NAT and http server in LAN l Linux Networking 2 05-16-2004 07:13 AM



1 2 3 4 5 6 7 8 9 10 11