Realtime Writers
  • Home
  • Writers
  • FAQ
  • Blog
  • Contact Us
  • My Account
  • Order Now
  • Menu Menu

http dummy proxy server

July 28, 2024/0 Comments/in Uncategorized /by Admin

http dummy proxy server

Paper details In this project, you will implement a web proxy that passes requests and data between multiple web clients and web servers. This assignment will give you a chance to get to know one of the most popular application protocols on the Internet — the Hypertext Transfer Protocol (HTTP). HTTP Proxy Getting Started – On your host machine (laptop), download the starter package. You will find the following starter code files: http_proxy.py test_scripts README.pdf Task Specification Your task is to build a web proxy capable of accepting HTTP requests, forwarding requests to remote (origin) servers, and returning response data to a client. The proxy will be implemented in your prefered language, and if you’re not using python, an Makefile to generate excutable and a brief instruction has to be provided. Your proxy program should run without errors. It should take as its first argument a port to listen from. Don’t use a hard-coded port number. If you use any other programming language, you need to supply a Makefile for compilation, and it should produce a executable file called http_proxy . You shouldn’t assume that your proxy will be running on a particular IP address, or that clients will be coming from a pre-determined IP address. 1. Dummy Proxy (100pts) Your proxy should listen on the port specified from the command line and wait for incoming client connections. Once a client has connected, the proxy should read data from the client and then check for a properly-formatted HTTP request. The client issues a request by sending a line of text to the proxy server. This request line consists of an HTTP method (most often “GET”, but “POST”, “PUT”, and others are possible), a request URI (like a URL), and the protocol version that the client wants to use (“HTTP/1.1”). The request line is followed by one or more header lines. The message body of the initial request is typically empty. URL in the HTTP request to a proxy server is required to be absolute URL, so you will obtain both host name and path to the file in request line. Your dummy proxy is only responsible for accepting the HTTP request. All requests should elicit a well-formed HTTP response with status code 501 “Not Implemented”. In the body of this HTTP response, you should supply a dummpy HTML page which prints: 1. the URL requested by client 2. client Web brower information if presented. 3. a message “You request will be forwarded.” (However, it won’t…unless you finish the next part). Note: You need to parse the HTTP message, don’t dump the entire message directly on the returned page. 2. Complete Proxy Servers(Extra point: 80pts) Before you start this part, make a copy of the code for the dummpy proxy and named it as “http_proxy_dummy.py”. Then continue to work on the file “http_proxy.py” 2.1 Sending Requests to Servers Once the proxy has parsed the URL in the client request, it can make a connection to the requested host (using the appropriate remote port, or the default of 80 if none is specified) and send the HTTP request for the appropriate resource. The proxy should always send the request in the relative URL + Host header format regardless of how the request was received from the client. For example, if the proxy accepts the following request from a client: GET http://www.example.com/ HTTP/1.1 It should send the following request to the remote server: GET / HTTP/1.1 Host: www.example.com Connection: close (Additional client specified headers, if any…) Note that we always send HTTP/1.1 flags and a Connection: close header to the server, so that it will close the connection after its response is fully transmitted, as opposed to keeping open a persistent connection. So while you should pass the client headers you receive on to the server, you should make sure you replace any Connection header received from the client with one specifying close , as shown. 2.2 Returning Response to Clients After the response from the remote server is received, the proxy should send the response message asis to the client via the appropriate socket. For any error caught by the proxy, the proxy should return the status 500 ‘Internal Error’.

As stated above, any request method other than GET should cause your proxy to return status 500 ‘Internal Error’ rather than 501 ‘Not Implemented’. Likewise, for any invalid, incorrectly formed headers or requests, your proxy should return status 500 ‘Internal Error’ rather than 400 ‘Bad Request’ to the client. Otherwise, your proxy should simply forward status replies from the remote server to the client. This means most 1xx, 2xx, 3xx, 4xx, and 5xx status replies should go directly from the remote server to the client through your proxy. (While you are debugging, make sure that 404 status replies from the remote server are not the result of poorly forwarded requests from your proxy.) 3. Concurrent Requests(20 pts) A practical web proxy should be able to support multiple clients at the same time. You may choose appropriate library to add multi-thread support into your program. Testing Your Proxy Run your proxy with the following command: python http_proxy.py & where port is the port number that the proxy should listen on. As a basic test of functionality, try requesting a page using telnet : telnet localhost Trying 127.0.0.1… Connected to localhost.localdomain (127.0.0.1). Escape character is ‘^]’. GET http://www.example.com/ HTTP/1.1 For the dummy proxy part, it should always return a HTTP 501 response. And for the complete proxy sever, if your proxy is working correctly, the headers and HTML of example.com should be displayed on your terminal screen. Notice here that we request the absolute URL ( http://www.example.com/ ) instead of just the relative URL ( / ). A good sanity check of proxy behavior would be to compare the HTTP response (headers and body) obtained via your proxy with the response from a direct telnet connection to the remote server. Additionally, try requesting a page using telnet concurrently from two different shells. Then try testing your proxy with the supplied test_proxy.py script. This will compare the result of fetching 4 pre-determined websites directly versus through your proxy: python testing_scripts/test_proxy.py http_proxy.py [port (optional, will be random if omitted)]

Share this entry
  • Share on WhatsApp
  • Link to Instagram
https://realtimewriters.com/wp-content/uploads/2025/01/Realtime-Writers-Transparent_white-bg.png 0 0 Admin https://realtimewriters.com/wp-content/uploads/2025/01/Realtime-Writers-Transparent_white-bg.png Admin2024-07-28 23:44:382024-07-28 23:44:38http dummy proxy server
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

You must be logged in to post a comment.

Calculate the Price

Deadline
Type of paper
Academic level
Pages
Plagiarism report FREE
Unlimited revisions FREE
Unlimited sources FREE
Title pageFREE
FormattingFREE

$0.00

Secure Payment

IntaSend Secure Payments (PCI-DSS Compliant) Secured by IntaSend Payments

Writing Services

  • Essays
  • Research Papers
  • Assignments
  • Course Work
  • Thesis

We Accept

  • PayPal
  • Visa
  • Mastercard
  • Apple Pay
  • Google Pay

© Realtime Writers | All Rights Reserved

Marketing Management Fundamentals Report on “Ministry by the Book” by Derek tidball Scroll to top

This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.

AcceptRejectSettings

Cookie and Privacy Settings



How we use cookies

We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

Essential Website Cookies

These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

Because these cookies are strictly necessary to deliver the website, refuseing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

Other external services

We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

Google Webfont Settings:

Google Map Settings:

Google reCaptcha Settings:

Vimeo and Youtube video embeds:

Privacy Policy

You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

Privacy Policy
Accept Reject

WhatsApp