title: Detecting whether a user is behind a proxy
body: <p>I'm trying to figure out how I could detect whether people logging into my site are behind a proxy or not.  I've read that you can detect a person's real IP address through embeddable objects (Flash and Java).  However, I haven't been able to actually find any examples or source for this.</p>
  
  <p>I'm using PHP and I've read that looking for <code>$_SERVER['HTTP_X_FORWARDED_FOR'], $_SERVER['HTTP_CLIENT_IP']</code>, etc. would detect most proxies but so far I haven't been able to by testing with TOR (maybe TOR doesn't flag those, but I've read that anonymous proxies still show <code>HTTP_X_FORWARDED</code>).  I'd like to try doing it with a java servlet, if possible.  Could anyone point me in the right direction (preferably with examples?)  I saw some code on ha.ckers.org but they only showed the client side and not the server side.</p>