24
Internet Application —— Final Project [email protected] BUPT/QMUL 2009-11-19

Internet Application —— Final Project

  • Upload
    leigh

  • View
    37

  • Download
    0

Embed Size (px)

DESCRIPTION

Internet Application —— Final Project. [email protected] BUPT/QMUL 2009-11-19. Agenda. Project description Related knowledge Timesheet. Agenda. Project description Related knowledge Timesheet. Final Lab. Subject: HTTP Proxy Server Goals - PowerPoint PPT Presentation

Citation preview

Page 1: Internet Application  —— Final Project

Internet Application —— Final Project

[email protected]/QMUL2009-11-19

Page 2: Internet Application  —— Final Project

Agenda

Project description Related knowledge Timesheet

Page 3: Internet Application  —— Final Project

Agenda

Project description Related knowledge Timesheet

Page 4: Internet Application  —— Final Project

Final Lab Subject: HTTP Proxy Server Goals

Forward HTTP data from browser to web server

Record and display related information Forbid the access to sites in black list

Requirements Understand HTTP Make Socket and Web programming Analyze network packets using wireshark

Page 5: Internet Application  —— Final Project

Details Basic functions (imperative)

Support multiple browsers concurrently URL can contain domain name and port number If browsers access sites in your “black list” proxy server will

redirect them to your page written in HTML with cautions Display following contents as the output of proxy server:

HTTP version, browser type, client OS, language, site name, web server name and web server OS.

Advanced functions (optional) The cautions page can display picture, audio or video Proxy server can authenticate user by name and password Display “you are using proxy” at the top of requested pages Display following contents as the output of proxy server:

the click counts of sites visited, proxy server response timeand user network traffic through browser

Page 6: Internet Application  —— Final Project

Work Flow

This chart shows one available work flow of http proxy server

You should add advanced functions or your own design in the proper places

Page 7: Internet Application  —— Final Project

Packets without Proxy1. telnet www.baidu.com 80

2. The results returned immediately as following picture shown:

Page 8: Internet Application  —— Final Project

Packets with Proxy - 1

1. Browser is configured with some proxy:

proxy.bupt.edu.cn:8080

2. The IP of the proxy proxy.bupt.edu.cn is 114.255.40.66

Page 9: Internet Application  —— Final Project

Packets with Proxy - 23. Visit www.baidu.com whose IP is 202.106.196.115

But the packets are sent to 114.255.40.66 as following picture shown:

Page 10: Internet Application  —— Final Project

What can we get from HTTP header?

You can try http://findmebyip.com/

More should be found in your own program!

Page 11: Internet Application  —— Final Project

Agenda

Project description Related knowledge Timesheet

Page 12: Internet Application  —— Final Project

Web Page Identifier Known as Uniform Resource Locator (URL) Encodes

Access protocol to use Domain name of server Protocol port number (optional) Path through server’s file system (optional) Parameters (optional) Query (optional)

Formathttp: // hostname [: port] / path [; parameters] [? query]

Page 13: Internet Application  —— Final Project

Web Standards Separate standards for

Representation HyperText Markup Language (HTML) Document contains text plus embedded links HTML gives guidelines for display, not details Consequence: two browsers may choose to

display same document differently Transfer

Used between browser and web server Protocol is HyperText Transfer Protocol (HTTP) Runs over TCP

Page 14: Internet Application  —— Final Project

HTTP Characteristics

Application level Request / response paradigm Stateless Permits bi-directional transfer Offers capability negotiation Support for caching Support for intermediaries

Page 15: Internet Application  —— Final Project

HTTP Operation Browser sends requests to which

server replies Typical request: GET used to fetch

document Example

GET http://www.baidu.com HTTP/1.1

Relative URL also permittedGET / HTTP/1.1

Page 16: Internet Application  —— Final Project

HTTP Headers HTTP uses MIME-like headers to carry meta

information. Both browsers and servers send headers that

allow them to negotiate agreement on the document representation and encoding to be used.

If the user agent wishes to send the userid "Aladdin" and password "open sesame", it would use the following header field: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== “QWxhZGRpbjpvcGVuIHNlc2FtZQ==” is the base64 encoding of “Aladdin:open sesame”

Page 17: Internet Application  —— Final Project

Connections Persistent Connections

HTTP version 1.0 uses one TCP connection per transfer Browser forms TCP connection to server Browser sends GET request Server returns header describing item Server returns item Server closes connection

HTTP version 1.1 permits connection to persist across multiple requests

Handing Persistence To allow a TCP connection to persist through multiple

requests and responses, HTTP sends a length before each response.

If it does not know the length, a server informs the client, sends the response, and then closes the connection.

Page 18: Internet Application  —— Final Project

Headers And Length Encoding

HTTP headers use same syntax as email headers Lines of text followed by blank line Lines of text have form

keyword:information For persistent connection header

specifies length (in octets) of data item that follows

Page 19: Internet Application  —— Final Project

Items That Can Appear In An HTTP Header

Header Meaning

Content-Length Size of item in octets

Content-Type Type of item

Content-Encoding Encoding used for item

Content-Language Language(s) used in item

Page 20: Internet Application  —— Final Project

Items in HTTP Headers For Negotiation

Header Meaning

Accept-Encoding: Encoding can be supported

Accept-Charset: Charset can be supported

Accept-Language:

Language(s) can be supported

Page 21: Internet Application  —— Final Project

References Online Base64 encoding

http://www.ohyeal.cn/base64.jsp RFC2616

Hypertext Transfer Protocol -- HTTP/1.1 RFC2617

HTTP Authentication : Basic and Digest Access Authentication

HTML 4.01 Specificationhttp://www.w3.org/TR/html401/

Page 22: Internet Application  —— Final Project

Agenda

Project description Related knowledge Timesheet

Page 23: Internet Application  —— Final Project

07b07—07b10 完成方式

每两人一组,限同一个实验班内 今天交分组名单

验收截止日期 2009-12-31

报告截止日期 2010-01-03

文档内容 每组交一份实验报告 (pdf 格式 ) ,程序源码 压缩为 .tar.gz 、 .tgz 或者 .rar 、 .zip 格式文件

压缩文件命名 班级 _ 学号 _ 姓名 _ 实验题目 例如: 07b01_071234_ 李宁 _http

邮箱 [email protected] [email protected]

Page 24: Internet Application  —— Final Project

07b11—07b13 完成方式

每两人一组,限同一个实验班内 今天交分组名单

验收截止日期 2009-12-31

报告截止日期 2010-01-03

文档内容 每组交一份实验报告 (pdf 格式 ) ,程序源码 压缩为 .tar.gz 、 .tgz 或者 .rar 、 .zip 格式文件

压缩文件命名 班级 _ 学号 _ 姓名 _ 实验题目 例如: 07b01_071234_ 李宁 _http

邮箱 [email protected] [email protected]