[prog] How to Send HTML message to Konqueror web browser....

meredydd at everybuddy.com meredydd at everybuddy.com
Tue Oct 8 17:32:52 EST 2002


I think it's because you're not talking HTTP, you seem to be just dumping 
the response to the browser. This is fine for HTTP 0.9, which goes 
something like this:

Client: GET /
Server: <content here>

However, nowadays everyone uses HTTP 1.0 or 1.1, which goes like this:

Client:
GET / HTTP/1.0
Host: www.everybuddy.com
User-Agent: <my web browser>
<blank line>

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

<content here>


I'm guessing that Netscape 4 doesn't mind about you talking v0.9 to it, 
as it's an older browser, but KDE's HTTP ioslave probably doesn't bother 
planning for a server brain-dead enough to only know 0.9 :-P

As you're probably aware, given that you seem to be reading information 
from the incoming headers, the headers I just gave were just examples. 
However, it's advisable to get at least a Content-type header in there 
for standards' sake


AFAIK both \n and \r\n are OK as line endings to separate the headers.

Meredydd, who learnt all this the hard way while making surfboard 
(surfd.sourceforge.net)


> Thank you for pointing the problem...It works now.
> 
> I have another question:
> I'm running a simple "socket server" that can send
> back *everything* sent by web browser as HTML, so the
> message can be displayed by the web browser....
> It's works fine when I use Netscape Explorer. The
> message from socket server was displayed by
> Netscape...
> 
> But when I try it using Konqueror web browser, nothing
> was displayed!
> 
> I use some thing like this:
> 
> accept socket
> read socket
> write (socket, "<PRE><BODY>\n", 12);
> write (socket, "HTML MESSAGE\n",13);
> write (socket, " </PRE></BODY>\n", 15); 
> close socket
> 
> Please help.
> Regards,
> Abel
> 
> __________________________________________________
> Do you Yahoo!?
> Faith Hill - Exclusive Performances, Videos & More
> http://faith.yahoo.com
> _______________________________________________
> Programming mailing list
> Programming at linuxchix.org
> http://www.linuxchix.org/mailman/listinfo/programming


---------------------------------------------
This message was sent using Endymion MailMan.
http://www.endymion.com/products/mailman/





More information about the Programming mailing list