Plack::App::Proxy::Test(3pm)

Plack::App::Proxy::Test3pm

Is utilities to test plack::app::proxy.

Usage

  test_proxy(
      app   => $backend_app,
      proxy => sub { Plack::App::Proxy->new(remote => "http://$_[0]:$_[1]") },
      client => sub {
          my $cb = shift;
          my $res = $cb->(GET '/');
          ok $res->is_success, "Check the status line.";
      },
  );

Overview

Plack::App::Proxy::Test provids test_proxy function which wraps test_psgi of Plack::Test simply.

Functions

test_proxy
  test_proxy app    => $app, 
             proxy  => $proxy_cb->($app_host, $app_port), 
             client => $client_cb->($cb);

test_proxy runs two servers, '"app"' as an origin server and the proxy server. In '"proxy"' callback, you should create the proxy server instance to send requests to '"app"' server. Then '"client"' callback is called to run your tests. In '"client"' callback, all HTTP requests are sent to '"proxy"' server. (And the proxy server will proxy your request to the app server.)

Releases

6 releases since Debian 8 (Jessie); the text changed 1 time.

  1. 8–10
  2. 11–13

Author

Masahiro Honma <[email protected]>

From libplack-app-proxy-perl 0.29-1.1 in Debian 13 (Trixie). Parsed by carta from the page's man source.