Code Monkey home page Code Monkey logo

cproxy's Introduction

Caching Proxy

CProxy (CP) is a HTTP caching proxy server written in Python 3. With the aim of being able to surf the Internet completely offline, it will intercept Browser's HTTPs requests and decrypt the the traffic on-the-fly to store each successful HTTP response.

This work is inspired by coursera-dl and edx-dl.

Installation

pip3 install cproxy

If you want to install CP manually, you should install the following packages

  • pyOpenSSL
  • brotli
  • chardet

Or simple run pip install -r requirements.txt in the package's home directory.

Usage

  1. Run the program by executing

    $ cproxy
  2. Change browser's proxy setting to

    http://loaclhost:8080
  3. Visit "http://cp.ca" to install Certificate Authority (CA) (this is required. Otherwise you can only visit http websites off-line). For more detailed guidance, please refer to mitmproxy - Certificates.

  4. Viola, you can browse your favorite websites now.

  5. When disconnected from the Internet later, you can still visit those websites off-line. Or you can explicitly tell CP to use off-line mode

    cproxy -off
  6. For more options, run cproxy -h

    $ cproxy -h                                                              
    usage: CachingProxy arguments [-h] [-cd CACHE_DIR] [-p PORT] [-off] [-d]
    
    optional arguments:
      -h, --help            show this help message and exit
      -cd CACHE_DIR, --cache_dir CACHE_DIR
                            where to store caches
      -p PORT, --port PORT  server listening port
      -off, --offline       Offline mode
      -d, --debug           Enable debugging mode

TODOs

  • Caching HTTP/HTTPS websites
  • IPv6 support
  • Pre-fetching
  • Proxy (use proxychains for now)
  • Youtube support (lots of edx's videos are hosted on youtube. For now, youtube will be blocked when you visit course.edx.org thus to force player to use other video sources)

Thanks

The proxy server module of this project is based on BaseProxy.

cproxy's People

Contributors

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