summaryrefslogtreecommitdiff
path: root/tests/httpserver.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-12-17 23:47:22 +0100
committerDaniel Stenberg <daniel@haxx.se>2012-01-03 15:01:22 +0100
commit82180643f4886d47816cf654f2ee46114e9c296f (patch)
treeee7b55634dbeca7fd641397a6c10dd360cc602d4 /tests/httpserver.pl
parent585b89a6c3640af5a1ca963eeafc7d0d82408f00 (diff)
downloadcurl-82180643f4886d47816cf654f2ee46114e9c296f.tar.gz
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.
Diffstat (limited to 'tests/httpserver.pl')
-rwxr-xr-xtests/httpserver.pl14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/httpserver.pl b/tests/httpserver.pl
index 37161f061..693c67f8f 100755
--- a/tests/httpserver.pl
+++ b/tests/httpserver.pl
@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -40,6 +40,7 @@ my $idnum = 1; # dafault http server instance number
my $proto = 'http'; # protocol the http server speaks
my $pidfile; # http server pid file
my $logfile; # http server log file
+my $connect; # IP to connect to on CONNECT
my $srcdir;
my $fork;
my $gopher = 0;
@@ -82,6 +83,12 @@ while(@ARGV) {
shift @ARGV;
}
}
+ elsif($ARGV[0] eq '--connect') {
+ if($ARGV[1]) {
+ $connect = $ARGV[1];
+ shift @ARGV;
+ }
+ }
elsif($ARGV[0] eq '--id') {
if($ARGV[1] =~ /^(\d+)$/) {
$idnum = $1 if($1 > 0);
@@ -112,7 +119,12 @@ if(!$logfile) {
$flags .= "--gopher " if($gopher);
$flags .= "--fork " if(defined($fork));
+$flags .= "--connect $connect " if($connect);
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
$flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
+if($verbose) {
+ print STDERR "RUN: server/sws $flags\n";
+}
+
exec("server/sws $flags");