Implement a real-world application of http

Assignment Help Computer Network Security
Reference no: EM131434825

Computer Networks Assignment Laboratory: Web Proxy Server

I. Outline

Note that you are neither required to follow these steps nor required to use the skeleton code [link]. In the skeleton code, the missing parts that require your implementation is marked with a comment /********TO BE IMPLEMENTED********/. Please feel free to modify the helper classes if you prefer.

1. Run the client program ( client.h/cc) and understand the usage of the helper classes. Refer to .h files for function definitions and their purposes. Refer to .cc files for implementations. More information can be found in Section 4.

2. Complete the missing part of proxy.cc. Create a TCP socket to accept connection. For TCPSocket class, please use try/catch to capture exceptions. You can find samples in client program. Refer to Section 12 for logs.

3. Complete the five functions that has missing part in ProxyWorker.cc, in the following order, getRequest, checkRequest, forwardRequest, getResponse, and returnResponse. More details can be found in Section 8.

4. In getResponse, complete identify/default transfer encoding before working on chun- ked transfer encoding (Section 4). Refer to client program for more details.

5. Work on keyword filtering. Note that one requirement is filtering the hostname and the other is filtering the path. (Section 8).

6. Work on subliminal messages (Section 5).

7. Try your proxy with real browsers (not required).

II. Goals

Apply your knowledge of socket programming in order to implement a real-world application and gain some basic understanding of HTTP.

III. Overview

In this lab, you will implement a simple proxy server for HTTP that forwards requests from clients to end servers and returns responses from end servers to the clients. You will also implement a special function that inserts subliminal messages between HTTP web pages.

IV. Guidelines

Working alone or in pairs. You may work on this assignment individually or in pairs (not in groups of 3 or more, however). If you prefer to work in a pair, both students must submit a copy of the solution and identify their MSU NetID in a README file. If you prefer to work individually, please clearly state that you are working individually and include your MSU NetID in the README file.

Programming Language. You must implement this project using C++. The skeleton code is written in C++. Please clearly state the command to compile your project submission in your README file.

Testing your code. Each Linux distribution might be slightly different. It is the students' responsibility to make sure that the lab submissions compile on at least one of the following machines in 3353 EB: carl, ned, marge, mcclure, apu, krusty, rod or skinner. A statement must be provided in the README file's header. You will not be awarded any credit if your lab submission does not compile on any of those machines.

V. Specification

In this lab, you are required to implement a proxy that forwards GET requests from a client to the server and returns the responses from the server back to the client. The port for

listening to incoming request is assigned by the operating system. This lab addresses only non-persistent connections. The proxy is expected to be able to handle multiple requests by spawning a separate thread to handle each request. Both default (identity) encoding and chunked transfer encoding must be handled by this proxy. The requirement of the proxy is listed as follows.

Subliminal messages: The proxy needs to insert subliminal message webpages for HTTP requests where the target webpages has a filename extension of either .html or .htm. A supporting function HTTPRequest::isHtml is also provided for this purpose. A support- ing function ProxyWorker::subliminalResponse is provided to generate the subliminal response. Set the message duration to 0 will makes the response to flash and act like a subliminal message.

Modify Server field in the response header: To help with debugging, you are re- quired to add/modify a field in the response header, saying that this response is returned by your proxy. Specifically, you are required to add (or modify) the field Server with a string, such as your MSU NetID, showing the header has been modified. The method HTTPResponse::setHeaderField is able to do this.

Host not found: The proxy is expected to respond with error messages to bad requests. For a request that tries to download an object from a host that does not exist, the proxy returns a 404 Not Found response. As long as the end server exists, it is the responsibility of the server, not the proxy, to determine whether or not the requested web object exists. The proxy simply forwards the request and returns the response. A supporting function ProxyWorker::proxyResponse is provided for you to create response when error occurs.

Filtering: The proxy is expected to perform simple filtering.

1. The proxy rejects any request to a host containing the keyword "umich.edu" but allows requests where the file path contains the "umich.edu" keyword. The proxy returns a 403 Forbidden response for the former request. For example, the proxy shoud reject a request to https://umich.edu, but should forward to the server a request for
https://www.cse.msu.edu/~liuchinj/cse422ss17/lab2 files/umich.html

2. The proxy redirects any request to a path containing the keyword "harbaugh" to
https://www.cse.msu.edu/~liuchinj/cse422ss17/lab2 files/whoa.html

You can operate on the host and path information in the request using the supporting func- tions HTTPRequest::getHost, HTTPRequest::getPath, HTTPRequest::setHost and HTTPRequest::setPath before forwarding the request to the server. Alternatively, your proxy can also create a response that gives the client the Webpage you want using HTTPResponse class and replies the new response to the client without contacting the actual server.

Transfer Encoding: The proxy is required to handle both default transfer encoding and chunked transfer encoding. For default transfer encoding, the proxy is required to display (print to the console) the content length. For chunked transfer encoding, the proxy is required to display (print to the console) the length of each chunk.

Attachment:- Attachments.rar

Reference no: EM131434825

Questions Cloud

What should be the fair price of this asset today : a) What should be the fair price of this asset today? b) Suppose the price of this asset today equals $4. Is there anything you could do to make arbitrage money? Show formally the arbitrage strategy.
Describe a communication skill or interpersonal relationship : This assignment will take the entire term to complete and will be graded in the following three stages: First, you will select and describe a communication skill or interpersonal relationship you would like to improve (1-2 pages). Second, you wi..
Company that its default risk premium : You told the company that its default risk premium is 3%, the liquidity premium is 0.5%, the maturity risk premium is 1.0%, the rate on a 10 year government bond is 3.5% and inflation is expected to be 4% next year. What should the compny expect t..
Health care and the health care manager : Explain what impact the federal and state government in health care have on health care and the health care manager.
Implement a real-world application of http : CSE422-Apply your knowledge of socket programming in order to implement a real-world application and gain some basic understanding of HTTP.
What are the advantages of each type of survey : If you decided to do a survey, why, or under what conditions, would you choose to do a self-administered questionnaire as opposed to a face-to-face interview with subjects, a telephone survey, or an email survey? What are the advantages and disadv..
Devise an appropriate organogram for the company : CIS013-6 Develop an appropriate set of business objectives that incorporate the new online ordering system and outline the overall direction of the business over the next five years
Assumption of global macro economy : 1. What's your assumption of global macro economy in 2017? 2. How do you allocate your investment in different kinds of products this year? (please describe as detailed as you can, e.g. percentage of all products, durations, heding tools size(if ..
Forward price and initial value of forward contract : A stock is expected to pay a dividend of $1 per share in two months and in five months. The stock price is $50, and the risk-free rate of interest is 8% per annum with continuous compounding for all maturities. An investor has just taken a short p..

Reviews

Write a Review

Computer Network Security Questions & Answers

  An overview of wireless lan security - term paper

Computer Science or Information Technology deals with Wireless LAN Security. Wireless LAN Security is gaining importance in the recent times. This report talks about how vulnerable are wireless LAN networks without any security measures and also talk..

  Computer networks and security against hackers

This case study about a company named Magna International, a Canada based global supplier of automotive components, modules and systems. Along with the company analysis have been made in this assignment.

  New attack models

The Internet evolution is and is very fast and the Internet exposes the connected computers to attacks and the subsequent losses are in rise.

  Islamic Calligraphy

Islamic calligraphy or Arabic calligraphy is a primary form of art for Islamic visual expression and creativity.

  A comprehensive study about web-based email implementation

Conduct a comprehensive study about web-based email implementation in gmail. Optionally, you may use sniffer like wireshark or your choice to analyze the communication traffic.

  Retention policy and litigation hold notices

The purpose of this project is to provide you with an opportunity to create a document retention policy. You will also learn how to serve a litigation hold notice for an educational institute.

  Tools to enhance password protection

A report on Tools to enhance Password Protection.

  Analyse security procedures

Analyse security procedures

  Write a report on denial of service

Write a report on DENIAL OF SERVICE (DoS).

  Phising email

Phising email It is multipart, what are the two parts? The HTML part, is it inviting the recepient to click somewhere? What is the email proporting to do when the link is clicked?

  Express the shannon-hartley capacity theorem

Express the Shannon-Hartley capacity theorem in terms of where is the Energy/bit and is the psd of white noise.

  Modern symmetric encryption schemes

Pseudo-random generators, pseudo-random functions and pseudo-random permutations

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd