Re: Access IP address in POE::Component::Client::HTTP

Rocco Caputo <[email protected]> Sun, 31 Jan 2010 03:36:01 -0500
Newsgroups gmane.comp.lang.perl.poe
Message-ID <[email protected]>
I've just released POE::Component::Client::HTTP 0.894 to PAUSE.  It  
adds an X-PCCH-Peer header to all responses.  The header contains the  
socket's remote address and port, separated by a dot.  "127.0.0.1.309"  
represents port 309 on localhost.

X-PCCH-Peer will contain the proxy's address.port if the client is  
connecting to a proxy.

-- 
Rocco Caputo - [email protected]


On Jan 27, 2010, at 11:02, Doreen Grey wrote:

> Hello all,
>
> I've built a web client application with  
> POE::Component::Client::HTTP. I followed the examples in the  
> cookbook (http://poe.perl.org/?POE_Cookbook/Web_Client) and  
> everything works fine.
>
> In my 'got_response' function I need to process the IP address of  
> the host this response came from. Let's say the $response->uri is http://poe.perl.org 
> , then I'll need the IP address 67.207.145.70 of that host.
>
> Of course I could do an additional lookup of that host:
>  DB<11> print inet_ntoa(inet_aton('poe.perl.org'))
> 67.207.145.70
>
> But because POE has already resolved this name, why should I have to  
> do it again. So, is there a way to access the remote IP address in  
> the 'got_response' function?
>
> Thanks for your help!
> Doreen
> -- 
> Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla  
> Firefox 3.5 -
> sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.