Hello monks!
I am looking for a solution how to do a HTTP get request to a IP (let's say 192.168.0.100), port 80 by specifying virtual host that does not exist (non existing domain)! I am connecting to servers that have multiple vhosts defined on single IP but these vhosts are internal (e.g. server1, server2 etc.). If I enter IP and host into hosts file it works just by getting http://server1/ etc. but I need to run my script also on servers where I can not modify hosts file.
Somebody already suggested to me that I should try to specify server's IP address as proxy in LWP::UserAgent request like:
my $ua = LWP::UserAgent->new; $ua->proxy('http','http://192.168.0.100:80/'); my $response = $ua->get('http://server1/');
but this doesn't work (it returns 500 Can't connect to 192.168.0.100:80 (connect: No route to host))
Can someone suggest how this could be done without the need to modify /etc/hosts file? Thanx!
In reply to Get data via HTTP on IP and specify virtual host by j99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |