Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv13069/bin
Modified Files:
rec-proxy
Log Message:
Added more documentation; Added parameters port and path
Index: rec-proxy
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/bin/rec-proxy,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** rec-proxy 3 Jan 2003 23:01:24 -0000 1.1.1.1
--- rec-proxy 15 Jan 2003 21:15:00 -0000 1.2
***************
*** 3,11 ****
--- 3,104 ----
# $Id$
+ =head1 NAME
+
+ rec-proxy - recording proxy (frontend to HTTP::WebTest::Recorder)
+
+ =head1 SYNOPSIS
+
+ rec-proxy [options]
+
+ Options:
+ -p, --port=PORT port to listen on
+ -P, --path=PATH path to access web interface of the proxy
+ -?, --help brief help message
+ --man full documentation
+ -V, --version version number
+
+ =head1 OPTIONS
+
+ =over 4
+
+ =item B<-p> PORT
+
+ =item B<--port>=PORT
+
+ Sets a port on which C<rec-proxy> listens. By default C<rec-proxy>
+ listens on 8000.
+
+ =item B<-P> PATH
+
+ =item B<--path>=PATH
+
+ By default web interface of the proxy is accessible via URL
+ C<http://localhost:PORT/webtest/PAGE>. This parameter configures the
+ proxy to give access to its web interface via
+ C<http://localhost:PORT/PATH/PAGE>.
+
+ =item B<-?>
+
+ =item B<--help>
+
+ Print a brief help message and exits.
+
+ =item B<--man>
+
+ Prints the manual page and exits.
+
+ =item B<-V>
+
+ =item B<--version>
+
+ Prints version number of
+ L<HTTP::WebTest::Recorder|HTTP::WebTest::Recorder> and exits.
+
+ =back
+
+ =head1 DESCRIPTION
+
+ This program starts recording proxy.
+
+ =head1 COPYRIGHT
+
+ Copyright (c) 2003 Ilya Martynov. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the same terms as Perl itself.
+
+ =head1 SEE ALSO
+
+ L<HTTP::WebTest::Recorder|HTTP::WebTest::Recorder>
+
+ =cut
+
use strict;
+ use Pod::Usage;
+ use Getopt::Long qw(:config gnu_getopt);
use HTTP::WebTest::Utils qw(start_webserver);
use HTTP::WebTest::Recorder;
+ my %OPTIONS = ();
+ GetOptions(\%OPTIONS,
+ qw(port|p=i path|P=s help|? version|V man)) or pod2usage(2);
+ pod2usage(1) if $OPTIONS{help};
+ pod2usage(-verbose => 2) if $OPTIONS{man};
+ if($OPTIONS{version}) {
+ my $version = HTTP::WebTest::Recorder->VERSION;
+ print <<TEXT;
+ wt - recording proxy (frontend to HTTP::WebTest::Recorder)
+
+ This program uses HTTP::WebTest::Recorder version $version.
+
+ Copyright (c) 2003 Ilya Martynov. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the same terms as Perl itself.
+ TEXT
+ exit 0;
+ }
+
main();
***************
*** 16,20 ****
my %param = @_;
! $recorder ||= HTTP::WebTest::Recorder->new;
my $response = $recorder->handle($param{request});
--- 109,113 ----
my %param = @_;
! $recorder ||= HTTP::WebTest::Recorder->new(ui_path => $OPTIONS{path});
my $response = $recorder->handle($param{request});
***************
*** 22,26 ****
};
! start_webserver(port => 8000,
server_sub => $server_sub);
}
--- 115,119 ----
};
! start_webserver(port => $OPTIONS{port} || 8000,
server_sub => $server_sub);
}
|