1 / 7

Build a Simple Web Server in C for MP8 Assignment

In this assignment, you will create a web server in C that serves HTML pages and various web file types. You'll need to test your web server using a browser (e.g., Firefox, Chrome, or IE). The server will process HTTP requests and print them to the console. This project involves understanding network protocols, specifically TCP and UDP, and using socket programming to handle client-server communication. Your goal is to read an HTTP request from a client and correctly display it in your program.

hye
Télécharger la présentation

Build a Simple Web Server in C for MP8 Assignment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 241 Section (04/19/12)

  2. MP8 • Web Server • Due: Tuesday, May 1st, 11:59pm • What will you be doing? • Creating a web-server in C that serves HTML pages and a few types of files found on the web. • You won’t test your program using a console! • To test: you’ll open up a web browser (such as Firefox, Chrome, IE, it doesn’t matter) and connect to your program. • You can also use wget to debug if IE / Firefox not working: • wget –d http://linux#.ews.illinois.edu

  3. MP8 • MP8 has you create a web server. • In today’s programming example, we’ll create a web server that gets an HTTP request and prints that to the console. • Preliminary step for your MP 8.

  4. Discussion Section Coding

  5. Network Choices • In main lecture, you have seen two different protocols: • TCP • UDP …what are the differences? …which one do we want to use for a web client?

  6. Network Choices • In main lecture, you have seen two different roles: • Server: • socket() • bind() • listen() • accept() • Client: • gethostbyname() / getaddinfo() • socket() • connect()

  7. Programming! • In the ds/ds11/ directory, you’ll find 1.c. • Goal: • Create a program to read HTTP request from a client and print that out.

More Related