title: using polipo and tor with python mechanize browser reveals ip on one site and not another
body: <p>I have minimal knowledge of networking. I have discovered a paradox and need advice on how to approach the solution.</p>
  
  <p>Experiment 1: A mechanize browser with a tor/polipo http proxy in a python script makes a request for a URL. The actual IP shows up in the site's log. (UNEXPECTED RESULT: I would like the tor IP to be revealed.)</p>
  
  <p>Experiment 2: A mechanize browser with a tor/polipo http proxy in a python script makes a request for a URL to whatismyip. The tor proxy IP as shows up in the results. (EXPECTED)</p>
  
  <p>Experiment 3: A Firefox browser using the tor proxy is pointed to whatismyip. The same IP as in experiment 2 is revealed. (EXPECTED)</p>
  
  <p>Experiment 4: A Chrome browser with no proxy is pointed to whatismyip and the actual IP of the machine is shown just as in experiment 1. (EXPECTED)</p>
  
  <p>Experiment 5: The HTTP proxy in the system network settings on Mac OS X is set to use the tor/polipo proxy on listening port 8123. The Chrome browser in Experiment 4 now shows the same tor IP as experiment 2 and 3. (EXPECTED)</p>
  
  <p>Tor is running. Polipo is running and configured to use tor port 9050.</p>
  
  <p>My python code:</p>
  
  <pre><code>    import sys, time, os
      from mechanize import Browser
      br = Browser()              # Create a browser
  br.set_proxies({"http": "localhost:8123"}) #set proxy
  result = br.open(URL)           # Open the login page
  print result.read()                     #print resulting output
  </code></pre>
  
  <p>where</p>
  
  <pre><code>    URL = 'http://affinityehealth.com' | URL = 'http://whatismyip.com'
  
      #case 1 is able to find the actual IP using the browser in mechanize but not with any other browser using the tor proxy
  </code></pre>
  
  <p>I am trying to make the point to the administrators of the web site that while logging IP's is useful, it does not prove the physical location of the person checking in. For weeks I have demonstrated using tor that while my physical location does not change, the physical location of the info requester appears to change in the site's logs when I check in via tor.</p>
  
  <p>I would really like my tor IP to show up when I use mechanize to go to this web site in an automated fashion for testing.</p>
  
  <p>I have one last experiment to try and that is setting my system wide proxy setting to tor in the network control panel. I really hate leaving this checked for routine browsing though because it is significantly slower. I only want my python script to use tor via the polipo http proxy.</p>
  
  <p>New to python. New to tor. New to networking so I thank you in advance for being redundantly redundant in your simple explanations.</p>