Skip to content

--- tags: - PACcategories: - Linuxdate:created: 2020-08-18# updated: 2024-01-19---

Linux Auto PAC

1. Install genpacIf pip is not installed, install pip firstsudo apt-get install python-pip``pip install genpac

2. Generate configuration file```

mkdir ~/shadowsocks cd shadowsocks genpac --proxy="SOCKS5 127.0.0.1:1080" --gfwlist-proxy="SOCKS5 127.0.0.1:1080" -o autoproxy.pac --gfwlist-url="https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt"

- 1080 represents the port number of the proxy
## 3. Enter the following command on the command line to check whether the agent is running normally```
curl -so /dev/null -w "%{http_code}" google.com -x socks5://127.0.0.1:1080
- socks5indicates the proxy protocol used, which can be replaced by other protocols such ashttp- 10080is the port number of the proxy, corresponding to the Input port of the proxy service

4. Configure system network Proxy### GUI interfaceOpen the following path[system] settings -> network -> network proxySelect the proxy mode as automatic, and fill in the configuration url as

file:///PATH_TO_PAC/autoproxy.pac - Fill in the path of the pac file according to the actual situation

REF[1]. https://stackoverflow.club/using-pac-in-linux/

[2]. Check whether the agent is running normally