hubert depesz lubaczewski <[EMAIL PROTECTED]> writes:
> Charles C. Fu wyrzeźbił(a):
> > If 10.2.1.7 complies even even minimally with HTTP/1.1, then you
> > can force requests to be sent to it by setting 10.2.1.7 to be your
> > proxy server. If limiting yourself to LWP::Simple, then the proxy
> > server is set through environment variables (e.g., set http_proxy
> > to http://10.2.1.7/). See the LWP::UserAgent man page for more
> > details.
>
> i'm not limiting myself to anything. right now i did it using plain
> sockets. in fact i was not thinking about using webserwer as proxy,
> and for some reasone i find this idea rather unpleasant. i would
> just to be able to send the request someplace else - without all
> this "proxy" things.
There is basically nothing more to the proxy concept, than the fact
that you send the request someplace else.
Another way of doing it is to plug in an alternative
LWP::Protocol::http module that for instance pick up the IP address
from a request header.
Or you can try this:
local @LWP::Protocol::http::EXTRA_SOCK_OPTS =
(PeerAddr => "10.2.1.7");
print $ua->get("http://www.example.com/foo");
Regards,
Gisle