App-PureProxy

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.0200  2024-01-23      Piotr Roszatycki <dexter@cpan.org>

* Thrall server is preferred when threads are enabled.
* Default number of workers is 50.
* Requires IO::Socket::IP.
* Requires Thrall 0.0402 and Starlight 0.0501.
* Provides cpanfile.
* Removed fatpack from the manifest.
* git.io is not used as it is obsoleted.
* Help shows options.

0.0100  2015-03-28      Piotr Roszatycki <dexter@cpan.org>

README  view on Meta::CPAN

    
        http_proxy=http://localhost:5000/ lwp-request -m get http://www.perl.org/
    
        https_proxy=http://localhost:5000/ lwp-request -m get https://metacpan.org/

DESCRIPTION

    This is pure-Perl HTTP proxy server which can be run on almost every
    Perl installation.

    It uses thrall pre-threading HTTP server if Perl supports threads or
    starlight pre-forking HTTP server otherwise.

    It supports SSL and TLS if IO::Socket::SSL is installed and IPv6 if
    IO::Socket::IP is installed.

    It can be fat-packed and then run with any system with standard Perl
    interpreter without installing other packages. See examples directory
    for fat-packed version of PureProxy script.

    PureProxy is an application that accepts arguments of plackup binary

README  view on Meta::CPAN

    Max. number of requests allowed per single persistent connection. If
    set to one, persistent connections are disabled. (default: 1)

 --max-reqs-per-child

    Max. number of requests to be handled before a worker process exits.
    (default: 1000)

 --max-workers

    A number of worker threads. (default: 50)

 --min-reqs-per-child

    If set, randomizes the number of requests handled by a single worker
    process between the value and that supplied by --max-reqs-per-chlid.
    (default: none)

 -p, --port

    Binds to a TCP port. Defaults to 5000. This option is only valid for

README  view on Meta::CPAN

    to after binding to the port. The pid file, error log or unix socket
    also are created before changing privileges. This option is usually
    used if the main process is started with root privileges because
    binding to the low-numbered (<1024) port. (default: none)

ENVIRONMENT

 PUREPROXY_SERVER

    Changes the default PSGI server. This is Thrall if Perl supports
    threads and Starlight otherwise.

SEE ALSO

    http://github.com/dex4er/PureProxy.

BUGS

    This tool has unstable features and can change in future.

AUTHOR

README.md  view on Meta::CPAN


    https_proxy=http://localhost:5000/ lwp-request -m get https://metacpan.org/

```

## DESCRIPTION

This is pure-Perl HTTP proxy server which can be run on almost every Perl
installation.

It uses [thrall](https://metacpan.org/pod/thrall) pre-threading HTTP server if Perl supports threads or
[starlight](https://metacpan.org/pod/starlight) pre-forking HTTP server otherwise.

It supports SSL and TLS if [IO::Socket::SSL](https://metacpan.org/pod/IO%3A%3ASocket%3A%3ASSL) is installed and IPv6 if
[IO::Socket::IP](https://metacpan.org/pod/IO%3A%3ASocket%3A%3AIP) is installed.

It can be fat-packed and then run with any system with standard Perl
interpreter without installing other packages. See `examples` directory for
fat-packed version of PureProxy script.

PureProxy is an application that accepts arguments of [plackup](https://metacpan.org/pod/plackup) binary and

README.md  view on Meta::CPAN

Max. number of requests allowed per single persistent connection. If set to
one, persistent connections are disabled. (default: 1)

## --max-reqs-per-child

Max. number of requests to be handled before a worker process exits. (default:
1000)

## --max-workers

A number of worker threads. (default: 50)

## --min-reqs-per-child

If set, randomizes the number of requests handled by a single worker process
between the value and that supplied by `--max-reqs-per-chlid`.
(default: none)

## -p, --port

Binds to a TCP port. Defaults to 5000. This option is only valid for

README.md  view on Meta::CPAN

Changes the user id or user name that the server process should switch to
after binding to the port. The pid file, error log or unix socket also are
created before changing privileges. This option is usually used if the main
process is started with root privileges because binding to the low-numbered
(<1024) port. (default: none)

## ENVIRONMENT

## PUREPROXY\_SERVER

Changes the default PSGI server. This is [Thrall](https://metacpan.org/pod/Thrall) if Perl supports threads
and [Starlight](https://metacpan.org/pod/Starlight) otherwise.

## SEE ALSO

[http://github.com/dex4er/PureProxy](http://github.com/dex4er/PureProxy).

## BUGS

This tool has unstable features and can change in future.

script/pureproxy.pl  view on Meta::CPAN

    }
}

BEGIN {
    *warnings::import = sub { };
}

use Config;

use constant SERVER => $ENV{PUREPROXY_SERVER}
    || $Config{useithreads} ? 'Thrall' : 'Starlight';

BEGIN {
    delete $ENV{http_proxy};
    delete $ENV{https_proxy};
}

use Plack::Builder;
use Plack::App::Proxy;

my $app = builder {

script/pureproxy.pl  view on Meta::CPAN


    https_proxy=http://localhost:5000/ lwp-request -m get https://metacpan.org/

=for markdown ```

=head1 DESCRIPTION

This is pure-Perl HTTP proxy server which can be run on almost every Perl
installation.

It uses L<thrall> pre-threading HTTP server if Perl supports threads or
L<starlight> pre-forking HTTP server otherwise.

It supports SSL and TLS if L<IO::Socket::SSL> is installed and IPv6 if
L<IO::Socket::IP> is installed.

It can be fat-packed and then run with any system with standard Perl
interpreter without installing other packages. See F<examples> directory for
fat-packed version of PureProxy script.

PureProxy is an application that accepts arguments of L<plackup> binary and

script/pureproxy.pl  view on Meta::CPAN

Max. number of requests allowed per single persistent connection. If set to
one, persistent connections are disabled. (default: 1)

=head2 --max-reqs-per-child

Max. number of requests to be handled before a worker process exits. (default:
1000)

=head2 --max-workers

A number of worker threads. (default: 50)

=head2 --min-reqs-per-child

If set, randomizes the number of requests handled by a single worker process
between the value and that supplied by C<--max-reqs-per-chlid>.
(default: none)

=head2 -p, --port

Binds to a TCP port. Defaults to 5000. This option is only valid for

script/pureproxy.pl  view on Meta::CPAN

Changes the user id or user name that the server process should switch to
after binding to the port. The pid file, error log or unix socket also are
created before changing privileges. This option is usually used if the main
process is started with root privileges because binding to the low-numbered
(E<lt>1024) port. (default: none)

=head1 ENVIRONMENT

=head2 PUREPROXY_SERVER

Changes the default PSGI server. This is L<Thrall> if Perl supports threads
and L<Starlight> otherwise.

=head1 SEE ALSO

L<http://github.com/dex4er/PureProxy>.

=head1 BUGS

This tool has unstable features and can change in future.



( run in 0.548 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )