Git Product home page Git Product logo

gproxy's Introduction

gproxy

gproxy exploits a Google web service hosted at images-onepick-opensocial.googleusercontent.com (which is commonly used to fetch user-provided content, e.g., to load images by URL in Google Documents) to proxy arbitrary HTTP(S) traffic.

Installation

Install with:

npm install -g git://github.com/cyrus-and/gproxy.git

Note that a global installation is not mandatory; the proxy can be started with npm start from the main directory. In that case, it may be easier to download the ZIP archive or clone the repo, instead of using npm install:

git clone https://github.com/cyrus-and/gproxy.git

Usage

  1. Generate a self-signed certificate (or skip this step and use the one bundled, which has been created for localhost, as shown below):

     openssl req -x509 -newkey rsa:2048 -nodes -days 3650 \
                 -subj '/CN=localhost' -keyout key.pem -out cert.pem
    

    Certificates (key.pem and cert.pem) in the current working directory will have the precedence over the one bundled.

  2. Start the proxy, optionally also specifying host and port. By default gproxy listens on localhost:8080 but this can be changed by setting two environment variables: GPROXY_HOST and GPROXY_PORT. For example with:

     export GPROXY_HOST=0.0.0.0
     export GPROXY_PORT=1234
     gproxy
    

    gproxy will listen on all the local interfaces on port 1234.

  3. Use http://localhost:8080 (or whatever has been chosen) as a proxy server in your client configuration for both HTTP and HTTPS traffic. Most programs look for specific environment variables like http_proxy and https_proxy. With Bash just:

     export http{,s}_proxy=http://localhost:8080
    

    Note that to load HTTPS websites the client must ignore certificate errors. Some examples:

     google-chrome --ignore-certificate-errors
     curl -k https://example.com
     wget --no-check-certificate https://example.com
    

Caveats

  • Custom client headers are not forwarded to the server (e.g., no cookies).

  • Redirects work but the client is not aware of that so the URL cannot be properly updated.

  • The content-disposition response header is lost.

Disclaimer

gproxy is just a PoC and should be treated as such. Proxying arbitrary web traffic is unlikely to be the original purpose of the aforementioned web service. Not to mention that even though the client identity is hidden to the final server, it is not to Google itself.

gproxy's People

Contributors

cyrus-and avatar

Stargazers

Angus H. 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.