Quick Test Proxy Setup with Squid

Ever needed to test your HTTP client app proxy support? Need an instant proxy test setup?

Here is a fast way to set up a local proxy server on Debian using squid:

1.) # apt-get install squid
2.) Edit the squid configuration /etc/squid/squid.conf
2.) a) Edit ACLs. Ensure to have something like the following:

acl all src all
acl users proxy_auth REQUIRED

2.) b) Edit access definitions. You need (order is important):

http_access allow users
http_access deny all

2.) c) Setup a dummy authentication module

auth_param basic program /usr/local/bin/squid_dummy_auth
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off

3.) Create a authentication script

# vi /usr/local/bin/squid_dummy_auth

Insert something like:

#!/bin/sh

while read dummy;
do
   echo OK
done

# chmod a+x /usr/local/bin/squid_dummy_auth

4.) Restart squid

# /etc/init.d/squid restart

With this you have a working Basic Auth proxy test setup running on localhost:3128.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.