Skip to content

WoBytes/abloprox

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

abloprox

This is my personal home-proxy to filter and clean the web. It will filter http and https requests to domains given in the blocklists.

Usage & Installation

Usage: ruby prxy.rb [port]

The default port is 3126

Now, change proxy settings for http and https to 127.0.0.1:3126 (or wherever you bound to)

Controlling abloprox

abloprox can be controlled via http requests to http://ablo.prox:

  • Reloading Blocklist: http://ablo.prox?cmd=reload
  • Start Logging: http://ablo.prox?cmd=log&v=1
  • Stop Logging: http://ablo.prox?cmd=log&v=0
  • Log Output: http://ablo.prox?cmd=info
  • git pull origin master http://ablo.prox?cmd=update (for pulling blocklists from a git remote)

Client configuration

Provide a PAC file

Drop a PAC file named example.pac similar the one below somewhere on a webserver and enter it's URL into the OS/browser proxy configuration:

// inspired by
// - https://de.wikipedia.org/wiki/Proxy_Auto-Config#Die_PAC-Datei
// - http://www.proxypacfiles.com/proxypac/index.php?option=com_content&view=article&id=58&Itemid=87
function FindProxyForURL(url, host) {
  if (shExpMatch(host,"*.fritz.box")) return "DIRECT";            // don't proxy local network
  if (shExpMatch(host,"*.local")) return "DIRECT";                // don't proxy local network
  if (shExpMatch(host,"*.akamaistream.net")) return "DIRECT";     // don't proxy streams
  return "PROXY <hostname_of_the_proxy>:3126";                    // Default return condition is the proxy on host <hostname_of_the_proxy>.
}

Auto-configuration

  1. ensure there's a host 'wpad' in the current network, see
  1. have a http webserver running on that host, e.g. lighttpd
  2. ensure http://wpad/wpad.dat contains a PAC file similar the one above.

Launch in background

Debian GNU/Linux

Preliminaries daemon:

$ apt-get install daemon

Crontab

@reboot daemon --name abloprox --chdir=/srv/abloprox --stdout=prxy.log --stderr=prxy.log -- ruby prxy.rb

Check status

$ daemon --verbose --name abloprox --running

OS X

Someone might want to start abloprox at login. To do so, add a LaunchAgent plist configuration-file into ~/Library/LaunchAgents. The file name should help you to identify the purpose, eg. com.example.abloprox.plist.

Example Configuration:

<?xml version="1.0" encoding="UTF-8"?>
	<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
	<plist version="1.0">
	<dict>
		<key>Label</key>
		<string>com.example.abloprox</string>
		<key>ProgramArguments</key>
		<array>
			<string>/usr/bin/ruby</string>
			<string>/Users/<myusername>/abloprox/prxy.rb</string>
		</array>
		<key>RunAtLoad</key>
		<true/>
		<key>StandardErrorPath</key>
		<string>/Users/<myusername>/abloprox/stderr.txt</string>
		<key>WorkingDirectory</key>
		<string>/Users/<myusername>/abloprox</string>
	</dict>
	</plist>

License

The MIT License (MIT)

(c) 2014 Ulrich Zurucker, http://cmrr.de

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

AdBlock HTTP Proxy Server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%