SPVM-Mojolicious

 view release on metacpan or  search on metacpan

lib/SPVM/Mojo/UserAgent/Proxy.pm  view on Meta::CPAN

C<static method new : L<Mojo::UserAgent::Proxy|SPVM::Mojo::UserAgent::Proxy> ();>

Create a new L<Mojo::UserAgent::Proxy|SPVM::Mojo::UserAgent::Proxy> object, and return it.

=head1 Instance Methods

=head2 detect

C<method detect : void ();>

Check environment variables C<HTTP_PROXY>, C<http_proxy>, C<HTTPS_PROXY>, C<https_proxy>, C<NO_PROXY> and C<no_proxy>
for proxy information. Automatic proxy detection can be enabled with the C<SPVM_MOJO_PROXY> environment variable.

=head2 is_needed

C<method is_needed : int ($domain : string) ;>

Check if request for domain would use a proxy server.

=head2 prepare

lib/SPVM/Mojo/UserAgent/Proxy.spvm  view on Meta::CPAN

  static method new : Mojo::UserAgent::Proxy () {
    
    my $self = new Mojo::UserAgent::Proxy;
    
    return $self;
  }
  
  # Instance Methods
  method detect : void () {
    
    if (length (my $_ = Sys->env("HTTP_PROXY"))) {
      $self->{http} = $_;
    }
    elsif (length (my $_ = Sys->env("http_proxy"))) {
      $self->{http} = $_;
    }
    
    if (length (my $_ = Sys->env("HTTPS_PROXY"))) {
      $self->{https} = $_;
    }
    elsif (length (my $_ = Sys->env("https_proxy"))) {



( run in 1.687 second using v1.01-cache-2.11-cpan-71847e10f99 )