Add test scenario pac-file-delivery
authorFabian Keil <fk@fabiankeil.de>
Fri, 5 Mar 2021 07:19:04 +0000 (08:19 +0100)
committerFabian Keil <fk@fabiankeil.de>
Wed, 20 Mar 2024 11:38:39 +0000 (12:38 +0100)
Sponsored by: Privoxy project funds collected at SPI

tests/cts/pac-file-delivery/data/test1 [new file with mode: 0644]
tests/cts/pac-file-delivery/privoxy.conf [new file with mode: 0644]

diff --git a/tests/cts/pac-file-delivery/data/test1 b/tests/cts/pac-file-delivery/data/test1
new file mode 100644 (file)
index 0000000..1967870
--- /dev/null
@@ -0,0 +1,50 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/html
+Content-Length: 18
+
+Here's your data.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+function FindProxyForURL(url, host) {
+    var proxy = "PROXY 127.0.0.1:9119; DIRECT";
+    var direct = "DIRECT";
+    if (isPlainHostName(host)) {
+        return direct;
+    }
+    if (url.substring(0, 4) == "ftp:" || url.substring(0, 6) == "rsync:") {
+        return direct;
+    }
+    return proxy;
+}
+</data>
+</proxy-reply>
+
+<client>
+<server>
+none
+</server>
+<name>
+CGI request for PAC file
+</name>
+<command option="no-include">
+http://config.privoxy.org/wpad.dat
+</command>
+</client>
+
+<verify>
+</verify>
+</testcase>
diff --git a/tests/cts/pac-file-delivery/privoxy.conf b/tests/cts/pac-file-delivery/privoxy.conf
new file mode 100644 (file)
index 0000000..0039865
--- /dev/null
@@ -0,0 +1,18 @@
+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 15