mirror of
https://github.com/curl/curl.git
synced 2026-08-25 04:13:32 +03:00
test proxy supports CONNECT
There's a new 'http-proxy' server for tests that runs on a separate port and lets clients do HTTP CONNECT to other ports on the same host to allow us to test HTTP "tunneling" properly. Test cases now have a <proxy> section in <verify> to check that the proxy protocol part matches correctly. Test case 80, 83, 95, 275, 503 and 1078 have been converted. Test 1316 was added.
This commit is contained in:
parent
585b89a6c3
commit
82180643f4
14 changed files with 597 additions and 60 deletions
|
|
@ -81,7 +81,7 @@ test1208 test1209 test1210 test1211 \
|
|||
test1220 \
|
||||
test1300 test1301 test1302 test1303 test1304 test1305 \
|
||||
test1306 test1307 test1308 test1309 test1310 test1311 test1312 test1313 \
|
||||
test1314 test1315 test1317 test1318 \
|
||||
test1314 test1315 test1316 test1317 test1318 \
|
||||
test2000 test2001 test2002 test2003 test2004
|
||||
|
||||
EXTRA_DIST = $(TESTCASES) DISABLED
|
||||
|
|
|
|||
|
|
@ -31,12 +31,13 @@ contents
|
|||
<client>
|
||||
<server>
|
||||
http
|
||||
http-proxy
|
||||
</server>
|
||||
<name>
|
||||
HTTP 1.0 CONNECT with proxytunnel and downgrade GET to HTTP/1.0
|
||||
</name>
|
||||
<command>
|
||||
--proxy1.0 %HOSTIP:%HTTPPORT -p http://%HOSTIP:%HTTPPORT/we/want/that/page/1078 http://%HOSTIP:%HTTPPORT/we/want/that/page/1078
|
||||
--proxy1.0 %HOSTIP:%PROXYPORT -p http://%HOSTIP:%HTTPPORT/we/want/that/page/1078 http://%HOSTIP:%HTTPPORT/we/want/that/page/1078
|
||||
</command>
|
||||
</client>
|
||||
|
||||
|
|
@ -46,11 +47,13 @@ HTTP 1.0 CONNECT with proxytunnel and downgrade GET to HTTP/1.0
|
|||
<strip>
|
||||
^User-Agent:.*
|
||||
</strip>
|
||||
<protocol>
|
||||
<proxy>
|
||||
CONNECT %HOSTIP:%HTTPPORT HTTP/1.0
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Proxy-Connection: Keep-Alive
|
||||
|
||||
</proxy>
|
||||
<protocol>
|
||||
GET /we/want/that/page/1078 HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
|
|
|
|||
62
tests/data/test1316
Normal file
62
tests/data/test1316
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
PASV
|
||||
LIST
|
||||
HTTP CONNECT
|
||||
</keywords>
|
||||
</info>
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
# When doing LIST, we get the default list output hard-coded in the test
|
||||
# FTP server
|
||||
<datacheck>
|
||||
HTTP/1.1 200 Mighty fine indeed
|
||||
|
||||
HTTP/1.1 200 Mighty fine indeed
|
||||
|
||||
total 20
|
||||
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||
</datacheck>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
ftp
|
||||
http-proxy
|
||||
</server>
|
||||
<name>
|
||||
FTP LIST tunneled through HTTP proxy
|
||||
</name>
|
||||
<command>
|
||||
ftp://%HOSTIP:%FTPPORT/ -p -x %HOSTIP:%PROXYPORT
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<protocol>
|
||||
USER anonymous
|
||||
PASS ftp@example.com
|
||||
PWD
|
||||
EPSV
|
||||
TYPE A
|
||||
LIST
|
||||
QUIT
|
||||
</protocol>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
@ -41,12 +41,13 @@ contents
|
|||
<client>
|
||||
<server>
|
||||
http
|
||||
http-proxy
|
||||
</server>
|
||||
<name>
|
||||
HTTP CONNECT with proxytunnel getting two URLs from the same host
|
||||
</name>
|
||||
<command>
|
||||
http://remotesite.com/we/want/that/page/275 -p -x %HOSTIP:%HTTPPORT --user iam:myself --proxy-user youare:yourself http://remotesite.com/we/want/that/page/275
|
||||
http://remotesite.com:%HTTPPORT/we/want/that/page/275 -p -x %HOSTIP:%PROXYPORT --user iam:myself --proxy-user youare:yourself http://remotesite.com:%HTTPPORT/we/want/that/page/275
|
||||
</command>
|
||||
</client>
|
||||
|
||||
|
|
@ -56,21 +57,23 @@ http://remotesite.com/we/want/that/page/275 -p -x %HOSTIP:%HTTPPORT --user iam:m
|
|||
<strip>
|
||||
^User-Agent:.*
|
||||
</strip>
|
||||
<protocol>
|
||||
CONNECT remotesite.com:80 HTTP/1.1
|
||||
Host: remotesite.com:80
|
||||
<proxy>
|
||||
CONNECT remotesite.com:%HTTPPORT HTTP/1.1
|
||||
Host: remotesite.com:%HTTPPORT
|
||||
Proxy-Authorization: Basic eW91YXJlOnlvdXJzZWxm
|
||||
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
|
||||
Proxy-Connection: Keep-Alive
|
||||
|
||||
</proxy>
|
||||
<protocol>
|
||||
GET /we/want/that/page/275 HTTP/1.1
|
||||
Authorization: Basic aWFtOm15c2VsZg==
|
||||
Host: remotesite.com
|
||||
Host: remotesite.com:%HTTPPORT
|
||||
Accept: */*
|
||||
|
||||
GET /we/want/that/page/275 HTTP/1.1
|
||||
Authorization: Basic aWFtOm15c2VsZg==
|
||||
Host: remotesite.com
|
||||
Host: remotesite.com:%HTTPPORT
|
||||
Accept: */*
|
||||
|
||||
</protocol>
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ ETag: "21025-dc7-39462498"
|
|||
<client>
|
||||
<server>
|
||||
http
|
||||
http-proxy
|
||||
</server>
|
||||
# tool is what to use instead of 'curl'
|
||||
<tool>
|
||||
|
|
@ -47,7 +48,7 @@ lib503
|
|||
simple multi http:// through proxytunnel with authentication info
|
||||
</name>
|
||||
<command>
|
||||
http://%HOSTIP:%HTTPSPORT/503 %HOSTIP:%HTTPPORT
|
||||
http://%HOSTIP:%HTTPPORT/503 %HOSTIP:%PROXYPORT
|
||||
</command>
|
||||
<file name="log/test503.txt">
|
||||
foo
|
||||
|
|
@ -60,15 +61,17 @@ moo
|
|||
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<protocol>
|
||||
CONNECT %HOSTIP:%HTTPSPORT HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPSPORT
|
||||
<proxy>
|
||||
CONNECT %HOSTIP:%HTTPPORT HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Proxy-Authorization: Basic dGVzdDppbmc=
|
||||
Proxy-Connection: Keep-Alive
|
||||
|
||||
</proxy>
|
||||
<protocol>
|
||||
GET /503 HTTP/1.1
|
||||
Authorization: Basic dGVzdDppbmc=
|
||||
Host: %HOSTIP:%HTTPSPORT
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Accept: */*
|
||||
|
||||
</protocol>
|
||||
|
|
|
|||
|
|
@ -43,12 +43,13 @@ contents
|
|||
<client>
|
||||
<server>
|
||||
http
|
||||
http-proxy
|
||||
</server>
|
||||
<name>
|
||||
HTTP 1.0 CONNECT with proxytunnel and host Basic authentication
|
||||
HTTP 1.0 CONNECT with proxytunnel and proxy+host Basic authentication
|
||||
</name>
|
||||
<command>
|
||||
http://%HOSTIP:%HTTPPORT/we/want/that/page/80 -p --proxy1.0 %HOSTIP:%HTTPPORT --user iam:myself --proxy-user youare:yourself
|
||||
http://%HOSTIP:%HTTPPORT/we/want/that/page/80 -p --proxy1.0 %HOSTIP:%PROXYPORT --user iam:myself --proxy-user youare:yourself
|
||||
</command>
|
||||
</client>
|
||||
|
||||
|
|
@ -58,13 +59,15 @@ http://%HOSTIP:%HTTPPORT/we/want/that/page/80 -p --proxy1.0 %HOSTIP:%HTTPPORT --
|
|||
<strip>
|
||||
^User-Agent:.*
|
||||
</strip>
|
||||
<protocol>
|
||||
<proxy>
|
||||
CONNECT %HOSTIP:%HTTPPORT HTTP/1.0
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Proxy-Authorization: Basic eW91YXJlOnlvdXJzZWxm
|
||||
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
|
||||
Proxy-Connection: Keep-Alive
|
||||
|
||||
</proxy>
|
||||
<protocol>
|
||||
GET /we/want/that/page/80 HTTP/1.1
|
||||
Authorization: Basic aWFtOm15c2VsZg==
|
||||
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
|
||||
|
|
|
|||
|
|
@ -40,12 +40,13 @@ contents
|
|||
<client>
|
||||
<server>
|
||||
http
|
||||
http-proxy
|
||||
</server>
|
||||
<name>
|
||||
HTTP over proxy-tunnel with site authentication
|
||||
</name>
|
||||
<command>
|
||||
http://%HOSTIP:%HTTPPORT/we/want/that/page/83 -p -x %HOSTIP:%HTTPPORT --user iam:myself
|
||||
http://%HOSTIP:%HTTPPORT/we/want/that/page/83 -p -x %HOSTIP:%PROXYPORT --user iam:myself
|
||||
</command>
|
||||
</client>
|
||||
|
||||
|
|
@ -55,12 +56,14 @@ http://%HOSTIP:%HTTPPORT/we/want/that/page/83 -p -x %HOSTIP:%HTTPPORT --user iam
|
|||
<strip>
|
||||
^User-Agent:.*
|
||||
</strip>
|
||||
<protocol>
|
||||
<proxy>
|
||||
CONNECT %HOSTIP:%HTTPPORT HTTP/1.1
|
||||
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Proxy-Connection: Keep-Alive
|
||||
|
||||
</proxy>
|
||||
<protocol>
|
||||
GET /we/want/that/page/83 HTTP/1.1
|
||||
Authorization: Basic aWFtOm15c2VsZg==
|
||||
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
|
||||
|
|
|
|||
|
|
@ -40,12 +40,13 @@ contents
|
|||
<client>
|
||||
<server>
|
||||
http
|
||||
http-proxy
|
||||
</server>
|
||||
<name>
|
||||
HTTP over proxytunnel using POST
|
||||
</name>
|
||||
<command>
|
||||
http://%HOSTIP:%HTTPPORT/we/want/that/page/95 -p -x %HOSTIP:%HTTPPORT -d "datatopost=ohthatsfunyesyes"
|
||||
http://%HOSTIP:%HTTPPORT/we/want/that/page/95 -p -x %HOSTIP:%PROXYPORT -d "datatopost=ohthatsfunyesyes"
|
||||
</command>
|
||||
</client>
|
||||
|
||||
|
|
@ -55,12 +56,14 @@ http://%HOSTIP:%HTTPPORT/we/want/that/page/95 -p -x %HOSTIP:%HTTPPORT -d "datato
|
|||
<strip>
|
||||
^User-Agent:.*
|
||||
</strip>
|
||||
<protocol nonewline="yes">
|
||||
<proxy>
|
||||
CONNECT %HOSTIP:%HTTPPORT HTTP/1.1
|
||||
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
Proxy-Connection: Keep-Alive
|
||||
|
||||
</proxy>
|
||||
<protocol nonewline="yes">
|
||||
POST /we/want/that/page/95 HTTP/1.1
|
||||
User-Agent: curl/7.10.7-pre2 (i686-pc-linux-gnu) libcurl/7.10.7-pre2 OpenSSL/0.9.7a zlib/1.1.3
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue