Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emulating an HTTP server

Status
Not open for further replies.

siftach

Programmer
Jul 22, 2003
78
0
0
IL
I am trying to write a small server that will recieve and send data as if it is an HTTP server. Recieving the data works fine, but the result I send is unacceptable by the client. When using telnet I can see that the result is sent, but apperantly there's something missing.

This is how I send the result:

sprintf (buf, "Content-type: text/html\nX-Powered-By: SHVAServer 1.0.0\n<HTML><BODY>\n%s\n</BODY>\n</HTML>\n", Result);
send (ns, buf, strlen(buf), 0);

What is missing here?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top