Created
August 29, 2013 12:41
-
-
Save digulla/6377563 to your computer and use it in GitHub Desktop.
Command line utility to test and debug proxy.pac files. Depends on https://code.google.com/p/pacparser/
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
#!/usr/bin/env python2 | |
# Usage: $0 proxy.pac url | |
import pacparser | |
import sys | |
import urlparse | |
pacfile, url = sys.argv[1:] | |
pacparser.init() | |
pacparser.parse_pac_file(pacfile) | |
url = urlparse.urlparse(url) | |
site = '%s://%s' % (url.scheme, url.netloc) | |
print 'Proxy for %s is %s' % (site, pacparser.find_proxy(site, url.netloc)) | |
pacparser.cleanup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should add "Depends on https://code.google.com/p/pacparser/" to the comments in the script