1 / 24

Internet Application —— Final Project

Internet Application —— Final Project. zhaoqin@bupt.edu.cn BUPT/QMUL 2009-11-19. Agenda. Project description Related knowledge Timesheet. Agenda. Project description Related knowledge Timesheet. Final Lab. Subject: HTTP Proxy Server Goals

leigh
Download Presentation

Internet Application —— Final Project

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. Internet Application ——Final Project zhaoqin@bupt.edu.cn BUPT/QMUL 2009-11-19

  2. Agenda • Project description • Related knowledge • Timesheet

  3. Agenda • Project description • Related knowledge • Timesheet

  4. 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

  5. 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

  6. 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

  7. Packets without Proxy 1. telnet www.baidu.com 80 2. The results returned immediately as following picture shown:

  8. 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

  9. Packets with Proxy - 2 3. Visit www.baidu.com whose IP is 202.106.196.115But the packets are sent to 114.255.40.66 as following picture shown:

  10. What can we get from HTTP header? • You can try http://findmebyip.com/ More should be found in your own program!

  11. Agenda • Project description • Related knowledge • Timesheet

  12. 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]

  13. 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

  14. HTTP Characteristics • Application level • Request / response paradigm • Stateless • Permits bi-directional transfer • Offers capability negotiation • Support for caching • Support for intermediaries

  15. HTTP Operation • Browser sends requests to which server replies • Typical request: GET used to fetch document • ExampleGET http://www.baidu.com HTTP/1.1 • Relative URL also permittedGET / HTTP/1.1

  16. 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”

  17. 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.

  18. 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

  19. Items That Can Appear In An HTTP Header

  20. Items in HTTP Headers For Negotiation

  21. References • Online Base64 encoding http://www.ohyeal.cn/base64.jsp • RFC2616Hypertext Transfer Protocol -- HTTP/1.1 • RFC2617HTTP Authentication : Basic and Digest Access Authentication • HTML 4.01 Specificationhttp://www.w3.org/TR/html401/

  22. Agenda • Project description • Related knowledge • Timesheet

  23. 07b07—07b10 • 完成方式 • 每两人一组,限同一个实验班内 • 今天交分组名单 • 验收截止日期 • 2009-12-31 • 报告截止日期 • 2010-01-03 • 文档内容 • 每组交一份实验报告(pdf格式),程序源码 • 压缩为.tar.gz、.tgz或者.rar、.zip格式文件 • 压缩文件命名 • 班级_学号_姓名_实验题目 • 例如:07b01_071234_李宁_http • 邮箱 • leizy@buptnet.edu.cn • zhangyin@buptnet.edu.cn

  24. 07b11—07b13 • 完成方式 • 每两人一组,限同一个实验班内 • 今天交分组名单 • 验收截止日期 • 2009-12-31 • 报告截止日期 • 2010-01-03 • 文档内容 • 每组交一份实验报告(pdf格式),程序源码 • 压缩为.tar.gz、.tgz或者.rar、.zip格式文件 • 压缩文件命名 • 班级_学号_姓名_实验题目 • 例如:07b01_071234_李宁_http • 邮箱 • leizy@buptnet.edu.cn • zhangyin@buptnet.edu.cn

More Related