Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Understanding HTTP Protocol, Proxy Servers and COSC 6377 Term Project in Fall 2000, Study Guides, Projects, Research of Computer Systems Networking and Telecommunications

An overview of the http protocol, its role in the web's client-server model, and the concept of proxy servers. It also introduces the cosc 6377 term project and its tutorial for fall 2000. Students will learn about http messages, their format, and the differences between non-persistent and persistent connections.

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 08/17/2009

koofers-user-s4a
koofers-user-s4a 🇺🇸

10 documents

1 / 8

Toggle sidebar

Related documents


Partial preview of the text

Download Understanding HTTP Protocol, Proxy Servers and COSC 6377 Term Project in Fall 2000 and more Study Guides, Projects, Research Computer Systems Networking and Telecommunications in PDF only on Docsity! COSC 6377, Fall 2000 11/2/00 HTTP Protocol, Proxy, and COSC 6377 Term Project Tutorial T. Mark Huang http://www.cs.uh.edu/~jsteach/cosc6377/ COSC 6377, Fall 2000 2 The Web: the http protocol http: hypertext transfer protocol • Web’s application layer protocol • client/server model – client: browser that requests, receives, “displays” Web objects – server: Web server sends objects in response to requests • http1.0: RFC 1945, May 1996 • http1.1: RFC 2068, Jan. 1997 PC running Explorer Server running NCSA Web server Mac running Navigator http request http req ues t http response htt p re spo nse COSC 6377, Fall 2000 11/2/00 COSC 6377, Fall 2000 3 The http protocol: more http: TCP transport service: • client initiates TCP connection (creates socket) to server, port 80 • server accepts TCP connection from client • http messages (application-layer protocol messages) exchanged between browser (http client) and Web server (http server) • TCP connection closed URL (Uniform Resource Locator) has three parts: scheme, host name (w/port), and path name: http://www.someSchool.edu:port/someDept/pic.gif COSC 6377, Fall 2000 4 http example Suppose user enters URL http://www.someSchool.edu/someDepartment/index.html 1a. http client initiates TCP connection to http server (process) at www.someSchool.edu. Port 80 is default for http server. 2. http client sends http request message (containing URL) into TCP connection socket 1b. http server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client 3. http server receives request message, forms response message containing requested object (someDepartment/home.index), sends message into socket time (contains text, references to 10 jpeg images) COSC 6377, Fall 2000 11/2/00 COSC 6377, Fall 2000 9 http message format: respone HTTP/1.0 200 OK Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ... status line (protocol status code status phrase) header lines data, e.g., requested html file Common Status Code: 200 OK 301 Moved Permanently 400 Bad Request 403 Forbidden 404 Not Found COSC 6377, Fall 2000 10 HTTP Proxy • A HTTP proxy server deals with HTTP servers (web servers) on behalf of HTTP clients (browsers). • Proxy clients talk to proxy servers, which relay approved client requests on to real servers, and relay answers back to clients. client Proxy server client http requesthttp response http req ues t htt p re spo nse http req ues t htt p re spo nse http requesthttp response origin server origin server (1) (2) (3) (4) COSC 6377, Fall 2000 11/2/00 COSC 6377, Fall 2000 11 COSC 6377 Term Project Midget Service Corp (MSC) HTTP Proxy Server • Processing HTTP/1.0 • Configurable - configuration file (proxyrc) Port 500 #proxy_port refuse pegasus.cs.uh.edu #proxy_client block www.microsoft.com #proxy_location redirect www.netscape.com/(.*)\ “www3.netscape.com/\1” #proxy_location rewrite User-Agent “Netscape (.*)” “Mozilla \1” #proxy_hfield filter text/(.*) sed s/ok/good/g #proxy_filter • Processing Request - GET / POST / QUIT • Processing Reply - media filter • Multiple connections - fork() or select() COSC 6377, Fall 2000 12 Configuration Library proxy.h • int proxy_init (proxy_t* p, const char* rcfile) • int proxy_port(proxy_t* p) • int proxy_client(proxy_t* p, const char* host) • int proxy_location(proxy_t* p, const char* loc, char* buf, size_t bufsiz) • int proxy_hfield(proxy_t* p, const char* key, const char* value, char* buf, size_t bufsiz) • int proxy_filter(proxy_t* p, const char* media, char* buf, size_t bufsiz) COSC 6377, Fall 2000 11/2/00 COSC 6377, Fall 2000 13 fork() v.s. select() • to handle multiple connections • fork(): start a new process to handle each request. Easy to implement, but not scale well and require interlocking for shared resource. • select(): one process handles all requests. Scale well and do not require interlocking for shared resource, but more complex to implement (may need to build state diagram). COSC 6377, Fall 2000 14 Sample programs Located in ~jsteach/www/cosc6377/proxy/skel/ • sample1.c - clear channel echo TCP client • sample2.c & sample2-sig.c - clear channel echo TCP server For above client and sever programs, client sends whatever input from console to server , and server sends whatever input from console to client. You can use client to mimic browser and sever to mimic web server, and your proxy runs in-between them. • pipe.cc - pipe(2) example • http.cc - proxy filter library sample
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved