https://github.com/shaleh/pac-info
Simple tool to read PAC files and determine which proxy to use for a given URL
https://github.com/shaleh/pac-info
automation proxy-settings python
Last synced: 4 months ago
JSON representation
Simple tool to read PAC files and determine which proxy to use for a given URL
- Host: GitHub
- URL: https://github.com/shaleh/pac-info
- Owner: shaleh
- License: mit
- Created: 2016-03-22T19:19:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-05T17:35:37.000Z (almost 10 years ago)
- Last Synced: 2025-06-28T01:41:24.335Z (11 months ago)
- Topics: automation, proxy-settings, python
- Language: Python
- Size: 3.91 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= PAC Info Tool
Simple tools that use a PAC footnote:[https://en.wikipedia.org/wiki/Proxy_auto-config] file to determine what the proper proxy is for a given URL.
To install:
1. git clone https://github.com/pacparser/pacparser
1. cd pacparser
1. make -C src; sudo make -C src install
1. make -C src pymod; sudo make -C src install-pymod
1. cd pac-info
1. pip install -r requirements.txt
This will ensure the needed libraries are installed. Then you can copy the scripts to some place
in your `PATH` or just run them from the checkout. Don't forget to ensure they are `chmod +x`.
pac-info will retrieve the PAC file and tell you the PROXY used for a given domain. This is useful for setting up NO_PROXY for example.
You can use a tool like wget to retrieve the PAC file from the autocache site and use `--pac-file` instead of downloading the file each time.
```
$ pac-info --pac-url http://PROXY_AUTOCACHE google.com
$ pac-info --pac-url http://PROXY_AUTOCACHE some.internalsite.example.com # should be DIRECT and belongs in NO_PROXY
```
gen-proxy-env will output the needed proxy settings in a format ready for /etc/environment. It too can use `--pac-file`.
Example how to use it:
```
$ gen-proxy-env --pac-url http://PROXY_AUTOCACHE google.com
```