in reply to binding to a vhost using LWP
When I was testing, I added extra code in LWP::Protocol::http.pm after the socket is created, to make sure the local binding is correct:#!/usr/bin/perl use LWP::UserAgent; use strict; push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, "LocalPort" => "7000"); my $a = new LWP::UserAgent(); $a->proxy('http', 'http://ofgfw1.owfg.com:8080/'); $a->get("http://www.yahoo.com/");
And this passed.print $sock->sockaddr(), "\n"; print $sock->sockport(), "\n";
|
|---|