The manakai project

Web::Trasnport::ENVProxyManager

An environment variable based proxy manager

SYNOPSIS

  use Web::Transport::ENVProxyManager;
  $pm = Web::Transport::ENVProxyManager->new;
  $pm->get_proxies_for_url ($url)->then (sub {
    $proxies = $_[0];
  });

DESCRIPTION

The Web::Transport::ENVProxyManager object is a proxy manager, which choose proxies based on environment variables such as https_proxy.

This module is a proxy manager (see "PROXY MANAGERS" in Web::Transport).

METHODS

Following methods are available:

$pm = Web::Transport::ENVProxyManager->new

Create a proxy manager, using system's environment variable for this process (i.e. %ENV).

$pm = Web::Transport::ENVProxyManager->new_from_envs ($hashref)

Create a proxy manager. The argument must be a hash reference of environment variables. Hash keys must be environment variable names and values must be corresponding environment variable values. Names and values must be byte strings.

$promise = $pm->get_proxies ($url)

Get the list of the proxies for the specified URL. The argument must be a URL record (Web::URL).

The method returns a promise (Promise), which is to be resolved with a proxy configuration list (see "PROXY CONFIGURATIONS" in Web::Transport).

This module defines the encoding of the platform (see Web Transport Processing) as UTF-8, ignoring any LOCALE environment variable's encoding.

SPECIFICATION

Web Transport Processing <https://wiki.suikawiki.org/n/Web%20Transport%20Processing>.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

LICENSE

Copyright 2016 Wakaba <wakaba@suikawiki.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.