Skip to content

moazmuha/python-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 

Repository files navigation

Simple Python Proxy

• A Proxy Server using Python’s Socket API
• Proxy server handles simultaneous TCP connections
• Caches pages for set amount of time
• Adds label to inform client if they are accessing a Cached or Fresh version of the page
• Supports HTTP pages. Redirects any pages that use HTTPS

Contents

  1. User Guide
  2. Links for Testing
  3. Examples
  4. Notes

Guide

  1. Download the repo
  2. Run using "python proxy.py"
  3. Takes optional cache expire time argument. Default value for cache expire time is 120 seconds if no time argument is given. To specify time use command "python proxy.py [time]" where time is in an integer in seconds.
  4. In your browser enter http://localhost:8888/[websiteURL]. For example try http://localhost:8888/www.example.org

Links

Here are some links you can try. Note: Larger pages with many images may take some time to load. Be pateint :)

  1. http://localhost:8888/www.example.org (should load very quick)
  2. http://localhost:8888/www.cs.toronto.edu/~ylzhang/
  3. http://localhost:8888/www.cs.toronto.edu/~arnold/ (images may take time to show up)
  4. http://localhost:8888/www.cs.toronto.edu/~ylzhang/csc258/memes.html (may take time to load all images)

You may try to load all the pages at once in different tabs. Pages being loaded simultaneously have been tested but may slow down the loading of pages further. The available hardware resources of the system the server is running on can make a substantial difference in how long it may take pages to load. Cached pages should load significantly faster. If the pages refuse to load, try restarting the server. Your browser may also cache pages. You can use private windows to avoid browser caching.

Examples

image image proxy

Notes

• Improvements can be made, message me or open an issue if you would like to contribute
• Caching needs to be improved
• The same favicon.ico is used for all pages currently.
• The project was completed without the zlib library, hence why we request a decompressed version of pages so we can add the HTML tag without having to decompress data. This may be a cause of further slowdowns. However, not adding new imports was a requirement for this porject.

About

Python Proxy Server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages