Subject: | Request: proxy support |
It would be very useful to add proxy support, currently not present.
I have attached a patch to enable this feature in line with its implementation in
WWW::Mechanize. That is, the MediaWiki::API constructor will call 'env_proxy' on the underlying
LWP::UserAgent object unless instructed not to by a 'noproxy' config parameter.
Subject: | API.pm.noproxy.patch |
--- API.pm 2009-12-15 12:08:50.000000000 +0000
+++ API.pm.new 2009-12-15 12:11:40.000000000 +0000
@@ -112,6 +112,8 @@
=item * max_lag_retries = Integer value; The number of retries to send an API request if the server has reported a lag more than the value of max_lag. If the maximum retries is reached, an error is returned. Setting this to a negative value like -1 will mean the request is resent until the servers max_lag is below the threshold or another error occurs. Defaults to 4.
+=item * noproxy = Disable use of any proxy set in the environment.
+
=back
An example for the on_error configuration could be something like:
@@ -172,6 +174,7 @@
$ua->cookie_jar({});
$ua->agent(__PACKAGE__ . "/$VERSION");
$ua->default_header("Accept-Encoding" => "gzip, deflate");
+ $ua->env_proxy() unless ($config->{noproxy});
$self->{ua} = $ua;