tests: enable HTTP/2 tests to run with non-default port numbers
diff --git a/tests/http2-server.pl b/tests/http2-server.pl
index 72ed12e..086d5aa 100755
--- a/tests/http2-server.pl
+++ b/tests/http2-server.pl
@@ -28,6 +28,7 @@
 my $logfile = "log/http2.log";
 my $nghttpx = "nghttpx";
 my $listenport = 9015;
+my $connect = "127.0.0.1,8990";
 
 #***************************************************************************
 # Process command line options
@@ -54,6 +55,13 @@
             shift @ARGV;
         }
     }
+    elsif($ARGV[0] eq '--connect') {
+        if($ARGV[1]) {
+            $connect = $ARGV[1];
+            $connect =~ s/:/,/;
+            shift @ARGV;
+        }
+    }
     elsif($ARGV[0] eq '--logfile') {
         if($ARGV[1]) {
             $logfile = $ARGV[1];
@@ -66,7 +74,7 @@
     shift @ARGV;
 }
 
-my $cmdline="$nghttpx --backend=127.0.0.1,8990 ".
+my $cmdline="$nghttpx --backend=$connect ".
     "--frontend=\"*,$listenport;no-tls\" ".
     "--log-level=INFO ".
     "--pid-file=$pidfile ".
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 583ba3b..0da5b8e 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -1227,6 +1227,7 @@
 
     $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
     $flags .= "--port $HTTP2PORT ";
+    $flags .= "--connect $HOSTIP:$HTTPPORT ";
     $flags .= $verbose_flag if($debugprotocol);
 
     my $cmd = "$exe $flags";