1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- my $pidfile = "log/nghttpx.pid";
- my $logfile = "log/http2.log";
- my $nghttpx = "nghttpx";
- my $listenport = 9015;
- my $connect = "127.0.0.1,8990";
- while(@ARGV) {
- if($ARGV[0] eq '--verbose') {
- $verbose = 1;
- }
- elsif($ARGV[0] eq '--pidfile') {
- if($ARGV[1]) {
- $pidfile = $ARGV[1];
- shift @ARGV;
- }
- }
- elsif($ARGV[0] eq '--nghttpx') {
- if($ARGV[1]) {
- $nghttpx = $ARGV[1];
- shift @ARGV;
- }
- }
- elsif($ARGV[0] eq '--port') {
- if($ARGV[1]) {
- $listenport = $ARGV[1];
- 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];
- shift @ARGV;
- }
- }
- else {
- print STDERR "\nWarning: http2-server.pl unknown parameter: $ARGV[0]\n";
- }
- shift @ARGV;
- }
- my $cmdline="$nghttpx --backend=$connect ".
- "--frontend=\"*,$listenport;no-tls\" ".
- "--log-level=INFO ".
- "--pid-file=$pidfile ".
- "--errorlog-file=$logfile";
- print "RUN: $cmdline\n" if($verbose);
- system("$cmdline 2>/dev/null");
|