Net::Libproxy - Perl binding for libproxy ( http://code.google.com/p/libproxy/ )


Net-Libproxy documentation Contained in the Net-Libproxy distribution.

Index


Code Index:

NAME

Top

Net::Libproxy - Perl binding for libproxy ( http://code.google.com/p/libproxy/ )

SYNOPSIS

Top

  use Net::Libproxy;

  $p = new Net::Libproxy;
  $proxies = $p->getProxy('http://code.google.com/p/libproxy/');

  foreach my $proxy (@$proxies) {
    print $proxy."\n";
  }

DESCRIPTION

Top

libproxy is a lightweight library which makes it easy to develop applications proxy-aware with a simple and stable API.

EXPORT

These two functions are also exported. proxy_factory_new() proxy_factory_get_proxies()

SEE ALSO

Top

Libproxy homepage: http://code.google.com/p/libproxy/ Net::Libproxy on Gitorious: http://gitorious.org/net-libproxy You can also read proxy.h and Net/Libproxy.pm

AUTHOR

Top

Goneri Le Bouder, <goneri@rulezlan.org>

COPYRIGHT AND LICENSE

Top


Net-Libproxy documentation Contained in the Net-Libproxy distribution.

package Net::Libproxy;
use 5.008000;
use warnings;
our $VERSION = '0.03';

require Exporter;
require DynaLoader;
@ISA = qw(Exporter DynaLoader);
@EXPORT = qw(proxy_factory_new proxy_factory_get_proxies);

bootstrap Net::Libproxy;

sub new {
  my $self;

  $self->{pf} = Net::Libproxy::proxy_factory_new();

  bless $self;
}

sub getProxy {
  my ($self, $url) = @_;

  return Net::Libproxy::proxy_factory_get_proxies($self->{pf}, $url);
}

1;