title: Google Maps API authentication while forwarding over local network
body: <p>I'm using fiddler to forward my local webserver over our local network to test on mobile devices etc.</p>
  
  <pre><code>static function OnBeforeRequest(oSession: Session) {
      if (oSession.host.toLowerCase() == "192.168.1.100:8888") oSession.host="localhost:8020";
  }
  </code></pre>
  
  <p>This works fine, except I can't get google maps to authenticate properly with my API key, the dreaded message: </p>
  
  <blockquote>
    <p>Google has disabled use of the Maps API for this application. The
    provided key is not a valid Google API Key, or it is not authorized
    for the Google Maps Javascript API v3 on this site. If you are the
    owner of this application, you can learn about obtaining a valid key
    here:
    <a href="https://developers.google.com/maps/documentation/javascript/tutorial#api_key" rel="nofollow">https://developers.google.com/maps/documentation/javascript/tutorial#api_key</a></p>
  </blockquote>
  
  <p>I know the maps api is working on my local machine since I've added "localhost" to the allowed referrers section on the google api console.
  I have tried adding my global ip to this list, localhost:8888, localhost:8020 etc. to no avail.</p>
  
  <p>Is there a good way to track which referrer google is picking up so I can add it to my 'allowed' list? I've tried 'document.referrer' in JS, but that returns blank both on local(maps working), and local network remote access (through fiddler, maps not working).</p>
  
  <p>I'm not using PHP, so something in JS would be ideal; I assume this is possible since the google maps API is added as javascript!</p>
  
  <p>Any help would be appreciated, Cheers.</p>