Created
January 5, 2011 17:59
-
-
Save acorcutt/766693 to your computer and use it in GitHub Desktop.
This makes testing with domains and sub-domains easier on a mac, choose "Automatic Proxy Configuration" in Airport settings and set the URL to this file. Then any request to port 3000 will be pointed to the local rails server e.g. http://sub.mydomain.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(url, host) { | |
var port = url.match(/^\w{3,5}:\/\/[^:\/]*(:(\d+))?/)[2]; | |
if(port){ | |
if(port=="3000"){ | |
var proxy = "PROXY localhost"; | |
if(port){proxy += ":" + port;} | |
return proxy; | |
} | |
} | |
return "DIRECT"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment