title: HttpServletRequest.getRemoteAddr() in Tomcat returns IPv6 formatted IP address
body: <p>HttpServletRequest.getRemoteAddr() in Tomcat returns IPv6 formatted IP address, but I would like to configure it that returns IPv4.</p>
  
  <p>I access the servlet via 'localhost'. If I access it via '127.0.0.1' then returns IPv4 formatted IP address (see <a href="https://stackoverflow.com/questions/4020303/tomcat-log-format-disable-the-ipv6-format/4021201#4021201">this answer</a>).</p>
  
  <p>Environment:</p>
  
  <ul>
  <li>Windows 7 x64</li>
  <li>Tomcat 6.0.35-windows-x64</li>
  </ul>
  
  <p>My LAN connection properties:
  <strong>IPv6 is checked off</strong>, but it doesn't work neither if I check it on.</p>
  
  <p><img src="https://i.stack.imgur.com/h4ZFb.png" alt="My LAN connection properties"></p>