Giter Club home page Giter Club logo

cache-proxy's Introduction

Web Proxy with Cache

Author: Jeremiah Xing

Intro

This is a comandline tool to implement a web proxy with cache.

Usage

make all to compile the program.

make clean to clean the object files.

./proxy <port number> [cache replacement policy] to run the program.

for example:

./proxy 8080 to run the program with default cache replacement policy: LRU on 8080 port.

./proxy 8080 LRU to run the program with LRU cache replacement policy on 8080 port.

./proxy 8080 LFU to run the program with LFU cache replacement policy on 8080.

Test Environment

macOS / Linux

Recommended: Firefox

Easiest web browser to set up for using your proxy. Open up settings, and search for Proxy. In these settings, select manual proxy configuration. In the HTTP proxy field, enter in localhost (127.0.0.1) and the port your proxy is using. Next, browse to about:config. Search for network.proxy.allow_hijacking_localhost and set this value to True. This is required for firefox to use your proxy when accessing a web-server hosted on your local machine.

Additionally, you should disable browser caching to ensure all requests are served through your proxy. This can be done by setting browser.cache.disk.enable and browser.cache.memory.enable to False in about:config. Don't forget to turn these back on once you're done with the test!

Other Browsers

Other browsers, such as Chrome and Safari, can use a proxy. However, the default method for using a proxy in these browsers is to configure the entire system to use a proxy, rather than just the browser. Configuration can be achieved in the relevant settings page of these browsers. If possible, it would be best to install Firefox as it allows more fine-grained control, proxying only plain HTTP requests from just the browser.

Benchmark

run ./driver.sh in a Linux environment.

Reference

  1. Condition variables in C
  2. Signaling for condition variables (pthread_cond_signal vs pthread_cond_broadcast)
  3. How to prevent SIGPIPEs (or handle them properly)

cache-proxy's People

Contributors

jrmhx avatar shbanu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.