Install Privoxy
brew install privoxy
Update Privoxy configuration
...
listen-address 127.0.0.1:8118
forward-socks5 / 127.0.0.1 .
...
Start the Privoxy service
brew services start privoxy
Export HTTP_PROXY/HTTPS_PROXY
export HTTP_PROXY=http://127.0.0.1:8118
export HTTPS_PROXY=http://127.0.0.1:8118
export NO_PROXY=10.0.0.0/8,192.168.0.0/16