Advertisement
6_2008-2009 Complete Applications #200475

simple websever

I decided to write a very basic webserver as a learning experience. It ended up being fairly easy and I thought I would paste the code incase anyone else is interested. This code is meant to be a first step only, it uses the http protocol only for the GET command and then sends the requested html or image back to the web browser. It is not set up to transfer data files, handle forms or anything complex. Remember, this is merely meant to act as a starting place for anyone interested. If you do decide to go further into webserver development, I recommend you research the http protocol and look to more complex projects (such as opensource webservers). This makes a great learning tool (at least the way I like to learn). It is one file approx 200 lines of code - half of which are comments. No searching through complex classes or functions is required. I hope it helps anyone interested, for those who have more experience - feel free to share it! EDIT: I zipped up main.cpp and uploaded it - because the format of the code looked horrid when it was cut and pasted.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Upload
Original Comments (3)
Recovered from Wayback Machine