Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: request URL from a specified IP address

by anneli (Pilgrim)
on Oct 19, 2011 at 03:20 UTC ( #932276=note: print w/ replies, xml ) Need Help??


in reply to request URL from a specified IP address

You'll want to connect to the IP address, but set the Host header to the host (e.g. www.example.com). Assuming you're using LWP, it might look like this:

$ua->get($url, Host => $host);

Here, $url contains the full URL, where you can use the IP or any hostname that resolves to the correct IP, and $host contains the hostname you actually want to go to.

Hope this helps!


Comment on Re: request URL from a specified IP address
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932276]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2015-07-05 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (61 votes), past polls