--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Blafasel
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Blafasel
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+socks4
+</server>
+<name>
+Request forwarded through a SOCKS4 proxy
+</name>
+<features>
+proxy
+</features>
+<command>
+http://%HOSTIP:%HTTPPORT/socks4/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /socks4/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Blafasel
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Blafasel
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+socks4
+</server>
+<name>
+Request forwarded through a SOCKS4A proxy
+</name>
+<features>
+proxy
+</features>
+<command>
+http://%HOSTIP:%HTTPPORT/socks4a/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /socks4a/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Blafasel
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Blafasel
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+socks4
+</server>
+<name>
+Request forwarded through a SOCKS5 proxy. Destination host specified by IPv4 address.
+</name>
+<features>
+proxy
+</features>
+<command>
+http://%HOSTIP:%HTTPPORT/socks5/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /socks5/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Blafasel
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Blafasel
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+socks4
+</server>
+<precheck>
+# XXX: The test also requires that localhost resolves to 127.0.0.1 ...
+perl -e "print 'Test requires %HOSTIP 127.0.0.1' if ('%HOSTIP' ne '127.0.0.1');"
+</precheck>
+<name>
+Request forwarded through a SOCKS5 proxy. Destination host specified by domain name.
+</name>
+<features>
+proxy
+</features>
+<command>
+http://localhost:%HTTPPORT/socks5/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /socks5/%TESTNUMBER HTTP/1.1\r
+Host: localhost:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+# Skip for now as the Socks server from curl's test suite does
+# not seem to deal properly deal with optimistically sent data
+skip
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Blafasel
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Blafasel
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+socks4
+</server>
+<name>
+Request forwarded through a SOCKS5t proxy. Destination host specified by IPv4 address.
+</name>
+<features>
+proxy
+</features>
+<command>
+http://%HOSTIP:%HTTPPORT/socks5t/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /socks5t/%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+<client>
+<server>
+http
+socks4
+</server>
+<name>
+Request forwarded through a SOCKS5 proxy. Destination host specified by invalid IPv4 address.
+</name>
+<features>
+proxy
+</features>
+<command>
+-s --write-out '%{stderr}%{response_code}\n' http://127.1234.0.1:%HTTPPORT/socks5/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<stderr>
+503
+</stderr>
+</verify>
+</testcase>
--- /dev/null
+listen-address 127.0.0.1:9119
+
+debug 1 # Log the destination for each request Privoxy let through. See also debug 1024.
+debug 2 # show each connection status
+debug 4 # show tagging-related messages
+debug 8 # show header parsing
+debug 32 # debug force feature
+debug 64 # debug regular expression filters
+debug 128 # debug redirects
+debug 256 # debug GIF de-animation
+debug 512 # Common Log Format
+debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
+debug 4096 # Startup banner and warnings.
+debug 8192 # Non-fatal errors
+
+templdir ../../../templates
+
+keep-alive-timeout 5
+default-server-timeout 5
+
+forward-socks4 /socks4/ 127.0.0.1:20001 .
+forward-socks4a /socks4a/ 127.0.0.1:20001 .
+forward-socks5 /socks5/ 127.0.0.1:20001 .
+forward-socks5t /socks5t/ 127.0.0.1:20001 .
+forward /verifiedserver .