Proxy

Proxy DB 0.3

I've toiled on a few more features for the Proxy DB module (described in the past few posts).

Changes include:

  • Password protection is optional (if no password is set, the list of random proxies is freely displayed).
  • If the PHP installation supports GeoIP, and a list of flag icons is independently downloaded to flag-icons/ in the file directory, then the location of every proxy will be marked with a flag icon.
  • Whole lists of proxies can now be submitted in batch (by uploading a file or pasting its contents directly). These lists can include proxies with multiple ports open (such as 3128,8080-8090,55555). The lot will be tested using Drupal's Batch API, with a neat progress bar, and only functional proxies will be saved.

The Proxy DB module is available for download from the Ermarian Network, and there is a live production site at barred.ermarian.net.

* * *

In other news, it appears a young woman was killed in the protests (among many others) yesterday. RIP Neda.

Proxy database live

My last post on a Drupal-based database of proxy servers provided a link to the proxydb module I wrote. However, realistically the only potential user of the module, right now, is myself, since it is a very buggy unfinished version. So I set up a site ready for production use (after much further debugging).

The site runs on Drupal 7, which is extremely sleek. I still get almost 9M memory peak for bootstrap, unfortunately - but premature performance-tweaking is the root of all evil.

The newest code of the module can be downloaded at proxydb-7.x-0.2-r355.tar.gz.

The production site is at barred.ermarian.net. (I had the barred subdomain left over, and it seemed close enough in meaning to be repurposed for this).

---

Note that I am a newcomer to all this: Austin Heap already has a very good proxy list running (the development of which I'm following, and which I might contribute to as well). However, just as the proxies themselves, these resources are all at risk of filtering, so you could say "the more the merrier".

Proxy DB

After my last post on testing proxy servers, I spent the past 10 or so hours on what inevitably happens whenever I develop even the simplest web application: A Drupal module.

This particular module incorporates your basic "database table, create record, administer records" functionality for web proxies, but also uses a testing function similar to the one in the previous post, as well as a "continuous retesting" feature that rechecks the 15 oldest servers on each cron run (and eventually gives up on a server after a test repeatedly fails).

It's still full of bugs, since I don't actually have a database with dozens of proxies, and some parts are still untested. But I've managed to run it locally, add my own local proxy server to it, and then see it in the list.

The code is available over at the Ermarian Network, like my other Drupal modules that are not fit for d.o contrib (yet).

(Disclaimer: The above does not endorse any political view beyond that of defeating censorship in all its forms. As the sadly-fictional UN comissioner Pravin Lal said in Alpha Centauri: "Beware of anyone who would deny you access to information." I'll interfere in that any day. Smile )

Testing proxy servers

This is a simple tool to check a list of proxy servers for uptime. The scripts are available in zipped form (proxydb.tar.gz). You can also check out the SVN repository:

Quoting from the README file:

Requirements

  • Ability to run PHP scripts in command prompt.
  • PHP with curl extension.

Setup

Enter proxy files to be checked into a text file like this:

127.0.0.1:3128
127.0.1.1:80
127.0.1.2:8080

Edit main.php to enter the text file's name into the constant PROXYDB_FILE_PROXIES.

Usage

The script reads from standard input and writes to standard output by default.

$ php ./main.php proxies.txt output.txt
Testing 3 proxies.... done.

If a command-line argument is passed, that will be considered the filename of the input file.

$ php ./main.php proxies.txt 2/dev/null # silence stderr.
127.0.0.1:3128 up 200
127.0.1.1:80 down 403
127.0.1.2:8080 down 0

The second column of the tab-separated output will be either "up" or "down". The third is either "0" (if the IP did not respond) or a 3-digit HTTP response code. Only response codes of 200 are currently considered successful.

Configuration:

Open config.php with a text editor and change the constants defined in it. The available config values are as follows:

CONFIG_PROXYDB_FILE_INPUT [ = "-" ]
Input file. Can be overridden by the first command-line arg. A value of "-" refers to standard input.
CONFIG_PROXYDB_FILE_OUTPUT [ = "-" ]
Output file. A value of "-" refers to standard output.
CONFIG_PROXYDB_CHECK_URL
The URL that should be queried for testing. This URL must return a response of 200 (not, for example, 302 or 301). By default, the script downloads the Google Logo, being a small highly available static file on a network with good bandwidth.
CONFIG_PROXYDB_CHECK_TIMEOUT [ = 15 ]
The number of seconds to allow for a request to finish, in total.
Syndicate content