Minimal PAC (Proxy Auto-Configuration) server written in C. Serves a PAC file that routes specific domains through configured proxies while everything else goes direct.
PAC is natively supported by all major browsers and can be applied system-wide through OS-level proxy settings (GNOME, Windows, macOS).
make
make install # installs to ~/.local/binCreate a config file (see config.example):
SOCKS5 127.0.0.1:1080
discord.com
discord.gg
discordapp.com
PROXY 192.168.1.100:3128
example.com
example.org
Each proxy line (SOCKS5, SOCKS4, SOCKS, PROXY, HTTP, HTTPS) starts a group. Domains listed below it route through that proxy.
pac-server -c /path/to/config # custom config (default: /etc/pac-server/config)
pac-server -p 9000 # custom port (default: 8321)
pac-server -c config -p 9000 # bothThen set your automatic proxy configuration URL to http://127.0.0.1:8321/.
# ~/.config/systemd/user/pac-server.service
[Unit]
Description=PAC proxy auto-config server
After=network.target
[Service]
ExecStart=%h/.local/bin/pac-server -c %h/.config/pac-server/config
Restart=on-failure
[Install]
WantedBy=default.targetsystemctl --user enable --now pac-serverLike every other repo on GitHub, this project is for educational purposes only. Whatever you do with it — including bypassing your government's shitty restrictions — is not up to me.