Similar to https://stackoverflow.com/a/9029790/1069375
What is the most Symfony2 (built-in?) way to get the external/public IP address of the web server?
Eg. is there anything close to this?
$this->container->get('request')->getClientIp(); // returns string '::1' (length=3)
NOTE
I am coding and testing on localhost, behind a NAT firewall. I don't want "127.0.0.1" as an answer, but whatever web visitors would perceive should the gateway forward the www ports to my dev server. I already do use a dynamic DNS hostname, in case I have to resort to it, but prefer a more portable method.
To help avoid going off topic in the comments:
$_SERVER['REMOTE_ADDR'] // also returns '::1'