Tuesday, June 2, 2009

Writing a Web Server in C

Though the above heading may give you a headache when thinking "how to do it?", in practical sense it is pretty simple. I'm not talking about a fully functioning Web Server with wide array of functionalities, but a simple Web Server that will cater basic requirements of a Web Server. Through web surfing I found out some interesting web links which helped me to write my simple Web Server.

The way in which I did it was,
  1. First, got hold of a chat server (I used a one which I have written already).
  2. Then implemented the logic for handling http.

Following links helped me a lot in understanding the domain knowledge. If you'd like to have a look at the code feel free to drop a comment, I will be more than happy to share it with you :) .

2 comments:

erdee said...

Hi i'm newbie to c. i need webserver example written c and work linux. please share me your code. sorry for my english. my mail is zbi35@yahoo.com Sincerely

Heshan Suriyaarachchi said...

Hi Erdee,
Go through the following [1] link. It contains a code sample which will satisfy your requirement.

[1] - http://www.ibm.com/developerworks/eserver/library/es-nweb.html