]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test3028: verify PROXY
authorFata Nugraha <fatanugraha@outlook.com>
Wed, 9 Nov 2022 11:11:05 +0000 (18:11 +0700)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 10 Nov 2022 11:25:17 +0000 (12:25 +0100)
tests/data/Makefile.inc
tests/data/test3028 [new file with mode: 0644]

index 5c27bdf097bb65cf22ade2064a6880b8b7158677..9e585d602db80dd201485b61863fafd2b00a53a4 100644 (file)
@@ -247,6 +247,6 @@ test2300 test2301 test2302 test2303 \
 test3000 test3001 test3002 test3003 test3004 test3005 test3006 test3007 \
 test3008 test3009 test3010 test3011 test3012 test3013 test3014 test3015 \
 test3016 test3017 test3018 test3019 test3020 test3021 test3022 test3023 \
-test3024 test3025 test3026 test3027 \
+test3024 test3025 test3026 test3027 test3028 \
 \
 test3100
diff --git a/tests/data/test3028 b/tests/data/test3028
new file mode 100644 (file)
index 0000000..bc69e86
--- /dev/null
@@ -0,0 +1,73 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP CONNECT
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<connect>
+HTTP/1.1 200 Mighty fine indeed
+
+</connect>
+
+<data nocheck="yes">
+HTTP/1.1 404 Not Found
+Server: nginx/1.23.2
+Date: Wed, 09 Nov 2022 09:44:58 GMT
+Content-Type: text/plain; charset=utf-8
+Content-Length: 4
+Connection: keep-alive
+X-Content-Type-Options: nosniff
+
+haha
+</data>
+
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+http-proxy
+</server>
+<name>
+HTTP GET when PROXY Protocol enabled behind a proxy
+</name>
+<command>
+--haproxy-protocol http://%HOSTIP:%HTTPPORT/page --proxytunnel -x %HOSTIP:%PROXYPORT
+</command>
+<features>
+proxy
+</features>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strippart>
+s/^PROXY TCP4 %CLIENTIP %HOSTIP (\d*) %PROXYPORT/proxy-line/
+</strippart>
+
+<proxy>
+CONNECT %HOSTIP:%HTTPPORT HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Proxy-Connection: Keep-Alive\r
+\r
+</proxy>
+
+<protocol>
+proxy-line\r
+GET /page HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+
+</verify>
+</testcase>