From 5ce142f1bb90296b514f2f1ef25127adb592cd59 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 9 Mar 2021 10:16:06 +0100 Subject: [PATCH] Add test scenario forward-to-http-proxy Sponsored by: Privoxy project funds collected at SPI --- tests/cts/forward-to-http-proxy/data/test1 | 59 ++++++++++ tests/cts/forward-to-http-proxy/data/test2 | 83 ++++++++++++++ tests/cts/forward-to-http-proxy/data/test3 | 105 ++++++++++++++++++ tests/cts/forward-to-http-proxy/data/test4 | 105 ++++++++++++++++++ .../forward-to-http-proxy.action | 5 + tests/cts/forward-to-http-proxy/privoxy.conf | 23 ++++ 6 files changed, 380 insertions(+) create mode 100644 tests/cts/forward-to-http-proxy/data/test1 create mode 100644 tests/cts/forward-to-http-proxy/data/test2 create mode 100644 tests/cts/forward-to-http-proxy/data/test3 create mode 100644 tests/cts/forward-to-http-proxy/data/test4 create mode 100644 tests/cts/forward-to-http-proxy/forward-to-http-proxy.action create mode 100644 tests/cts/forward-to-http-proxy/privoxy.conf diff --git a/tests/cts/forward-to-http-proxy/data/test1 b/tests/cts/forward-to-http-proxy/data/test1 new file mode 100644 index 00000000..5c1c8333 --- /dev/null +++ b/tests/cts/forward-to-http-proxy/data/test1 @@ -0,0 +1,59 @@ + + + +HTTP +HTTP GET +HTTP proxy + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +Blafasel + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose + +Blafasel + + + + + + +http + + +Request forwarded through an HTTP proxy + + +proxy + + +http://www.example.org/%TESTNUMBER + + + + + +GET http://www.example.org/%TESTNUMBER HTTP/1.1 +Host: www.example.org +User-Agent: curl/%VERSION +Accept: */* + + + + diff --git a/tests/cts/forward-to-http-proxy/data/test2 b/tests/cts/forward-to-http-proxy/data/test2 new file mode 100644 index 00000000..af117b53 --- /dev/null +++ b/tests/cts/forward-to-http-proxy/data/test2 @@ -0,0 +1,83 @@ + + + +HTTP +HTTP GET +HTTP proxy + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 1 + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 11 + +Blafasel 2 + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 1 + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 11 + +Blafasel 2 + + + + + +http + + +Two requests forwarded through an HTTP proxy on a reused connection + + +proxy + + +http://www.example.org/%TESTNUMBER0000 http://www.example.org/%TESTNUMBER0001 + + + + + +GET http://www.example.org/%TESTNUMBER0000 HTTP/1.1 +Host: www.example.org +User-Agent: curl/%VERSION +Accept: */* + +GET http://www.example.org/%TESTNUMBER0001 HTTP/1.1 +Host: www.example.org +User-Agent: curl/%VERSION +Accept: */* + + + + diff --git a/tests/cts/forward-to-http-proxy/data/test3 b/tests/cts/forward-to-http-proxy/data/test3 new file mode 100644 index 00000000..27810b8f --- /dev/null +++ b/tests/cts/forward-to-http-proxy/data/test3 @@ -0,0 +1,105 @@ + + + +HTTP +HTTP GET +HTTP proxy + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 1 + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 2 + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 11 + +Blafasel 3 + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 1 + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 2 + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 3 + + + + + +http + + +Two requests forwarded through an HTTP proxy on a reused connection followed by request that needs a new connection + + +proxy + + +http://www.example.org/%TESTNUMBER0000 http://www.example.org/%TESTNUMBER0001 http://www.example.org/%TESTNUMBER0002 + + + + + +GET http://www.example.org/%TESTNUMBER0000 HTTP/1.1 +Host: www.example.org +User-Agent: curl/%VERSION +Accept: */* + +GET http://www.example.org/%TESTNUMBER0001 HTTP/1.1 +Host: www.example.org +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: www.example.org +User-Agent: curl/%VERSION +Accept: */* + + + + diff --git a/tests/cts/forward-to-http-proxy/data/test4 b/tests/cts/forward-to-http-proxy/data/test4 new file mode 100644 index 00000000..7fe4d12d --- /dev/null +++ b/tests/cts/forward-to-http-proxy/data/test4 @@ -0,0 +1,105 @@ + + + +HTTP +HTTP GET +HTTP proxy + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 1 + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 2 + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: close +Content-Type: text/html +X-Control: swsclose +Content-Length: 11 + +Blafasel 3 + + + + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 1 + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 2 + + +HTTP/1.1 200 OK +Date: Thu, 22 Jul 2010 11:22:33 GMT +Connection: keep-alive +Content-Type: text/html +Content-Length: 11 + +Blafasel 3 + + + + + +http + + +Two requests forwarded through an HTTP proxy on a reused connection followed by request that does not use a forwarder + + +proxy + + +http://www.example.org/%TESTNUMBER0000 http://www.example.org/%TESTNUMBER0001 http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002 + + + + + +GET http://www.example.org/%TESTNUMBER0000 HTTP/1.1 +Host: www.example.org +User-Agent: curl/%VERSION +Accept: */* + +GET http://www.example.org/%TESTNUMBER0001 HTTP/1.1 +Host: www.example.org +User-Agent: curl/%VERSION +Accept: */* + +GET /%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + + diff --git a/tests/cts/forward-to-http-proxy/forward-to-http-proxy.action b/tests/cts/forward-to-http-proxy/forward-to-http-proxy.action new file mode 100644 index 00000000..94791c83 --- /dev/null +++ b/tests/cts/forward-to-http-proxy/forward-to-http-proxy.action @@ -0,0 +1,5 @@ +{+forward-override{forward-webserver 127.0.0.1:20000}} +www.example.org/30002 + +{+forward-override{forward .}} +/40002 diff --git a/tests/cts/forward-to-http-proxy/privoxy.conf b/tests/cts/forward-to-http-proxy/privoxy.conf new file mode 100644 index 00000000..2a720420 --- /dev/null +++ b/tests/cts/forward-to-http-proxy/privoxy.conf @@ -0,0 +1,23 @@ +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 / 127.0.0.1:20000 + +actionsfile forward-to-http-proxy.action -- 2.39.2