[Catalyst] How to get IP address of the interface which the request come through

N.A. n-a at u01.gate01.com
Sat Mar 23 12:12:56 GMT 2013


I wan to get the  IP address of the interface(network device) which the
request come through.
This information can be easily obtained by

 "$c->engine->env->{ SERVER_ADDR }"

with FCGI setting both on nginx/lighttpd web servers.
However SERVER_ADDR is not defined in "Catalyst Test Server."

Of course the network device is usually 'eth0', but in some situation
the network device can be 'virbr0' , 'wlan0','eth1' and so on.
Are there any simple and portable way to get the information.

I use Catalyst of version 5.90020 on linux box.

N.A.



More information about the Catalyst mailing list