Git Product home page Git Product logo

autoproxy2privoxy's Introduction

AutoProxy2Privoxy

Overview

AutoProxy2Privoxy generates a list of Privoxy forward rules from a set of AutoProxy rules.

AutoProxy is a firefox addon that automatically determines which URLs are to be requested through a proxy, according to a predefined list of rules.

The AutoProxy2Pac program can produce a Proxy Auto-Config file out of the AutoProxy ruleset, to be used by all browsers that support PAC.

Privoxy, with forward rules set up correctly, can be used as a Proxy Auto-Config replacement, with the benefit of being universal for any program that uses the proxy.

Another advantage of using Privoxy is that, when forwarding to a SOCKS4a/SOCKS5 proxy, Privoxy will request the DNS resolution to happen on the remote side. This is beneficial for programs that do not support remote DNS resolution.

Inspired by AutoProxy2Pac, powered by Privoxy, and motivated by GFW, here, ladies and gentlemen, I present you AutoProxy2Privoxy!

How to Build

AutoProxy2Privoxy is a BASH script and needs not be built. This section talks about how to build the Privoxy forward rules from an AutoProxy ruleset.

The following example assumes a Linux environment. Also the famous gfwlist is used as the autoproxy ruleset input in the example below.

gfwlist=https://gitlab.com/gfwlist/gfwlist/raw/master/gfwlist.txt
wget -qO- "${gfwlist}" | base64 -D > gfwlist.txt
export PROXY_ADDR=127.0.0.1:1080 PROXY_TYPE=SOCKS5
chmod +x autoproxy2privoxy
./autoproxy2privoxy gfwlist.txt > gfw.action

Behold, this last command runs for a while.

How to Use

Privoxy supports all major operating systems. Installation paths may vary from platform to platform. The following assumes a Linux environment.

First, make sure the address and type of the target proxy is set correctly in gfw.action:

{+forward-override{forward-socks5 127.0.0.1:1080 .}}

Then issue the following commands as root:

cp gfw.action /usr/local/etc/privoxy/
chown privoxy:privoxy /usr/local/etc/privoxy/gfw.action
chmod 660 /usr/local/etc/privoxy/gfw.action

Now edit /usr/local/etc/privoxy/config, adding this line:

actionsfile gfw.action

Finally, make sure that forward rules are not set in /etc/privoxy/config, which is the default, unless you know what you're doing.

Privoxy should automatically pick up the new config. Now just point your program to Privoxy (localhost:8118 by default), who will automatically determine whether to forward to SOCKS or not.

License

This program is in the public domain, looking for a trade for a more robust implementation.

Fork the idea, guys.

Links

autoproxy2privoxy's People

Contributors

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