Re: Requests from different IP addresses?
Derek J. Balling (dballing@yahoo-inc.com)
Fri, 12 Jan 2001 10:53:39 -0800
At 10:31 AM -0800 1/12/01, Gisle Aas wrote:
>Stefan Kruger <stefan@inty.co.uk> writes:
>
>> For a machine with several IP-addresses, is it possible
>> to specify from which a HTTP::Request is sent?
>
>You can set the (undocumented) variable
>@LWP::Protocol::http::EXTRA_SOCK_OPTS to specify LocalAddr. This
>variable contains additional parameters that are always passed to
>IO::Socket::INET's constructor.
>
>Something like this:
>
> @LWP::Protocol::http::EXTRA_SOCK_OPTS = (LocalAddr => 'xxxxxxx');
>
> # The normal drill
> use LWP;
> my $ua = LWP::UserAgent->new;
> my $res = $ua->request(HTTP::Request->new(GET => "http://www.perl.org"));
>
> print $res->as_string;
Wouldn't that @LWP assignment have to come AFTER the 'use LWP'?
just making sure...
D
--
--------------------------------------------------------
Derek J. Balling 408-530-5062
Technical Yahoo Do You Yahoo!?