missing polipo/config file in /usr/local/etc/

3.2k Views Asked by At

I use brew to install polipo through Mac OS terminal. It seems successfully install, but I can not find the config file and edit it.Can anyone help me figure out the reason?

enter image description here

3

There are 3 best solutions below

0
On

I also used the brew to install polipo on Mac OS. Same problem as you met.

In fact, you need create the config file. The fail's path is ~/.polipo.

After you start the polipo service(brew services start polipo) Open the link: http://127.0.0.1:8123/polipo/config enter image description here

This is my config: enter image description here

socksParentProxy = "127.0.0.1:1086"
socksParentProxy
socksProxyType = socks5
proxyAddress = "::0"        # both IPv4 and IPv6
proxyPort = 8123
0
On

If polipo does not work:

I wanted to install polipo too, but even with the configuration files provided here, I was getting:

Error: polipo has been disabled because it is not supported upstream!

(MacBook Pro M1 chip. My socks proxy was generated with ssh -D 8000 -C -N myuser@statichost because of some static IP requirement).

So, I found out that you can also use an npm package to convert socks proxy to http proxy: https://www.npmjs.com/package/http-proxy-to-socks

# install hpts:
npm install -g http-proxy-to-socks

# launch http proxy:
hpts -s 127.0.0.1:8000 -p 8001
# here my socks5 proxy is at 127.0.0.1:8000 and the http proxy is now on port 8001

Npm does not support socks5 proxies, for example. So I used hpts to get an http proxy. After, I told npm to use that proxy with:

npm config set proxy http://127.0.0.1:8001
npm config set https-proxy http://127.0.0.1:8001
0
On
  • The config file will not be created automatically. You need to get sample config file. Run this command in Terminal:

    curl -o ~/.polipo https://raw.githubusercontent.com/jech/polipo/master/config.sample
    

    and for forbidden URLs:

    curl -o ~/.polipo-forbidden https://raw.githubusercontent.com/jech/polipo/master/forbidden.sample
    

    Then restart polipo to ensure that it will use the config file:

    launchctl unload /usr/local/opt/polipo/homebrew.mxcl.polipo.plist
    launchctl load /usr/local/opt/polipo/homebrew.mxcl.polipo.plist
    

    If it produced Service is disabled error, try this command to restart polio:

    brew services restart polipo
    

    Now open this address in your browser: http://127.0.0.1:8123/polipo/config

    You should see this line at the top:

    configFile  /Users/YourUserName/.polipo Configuration file.
    

    If so, you need to modify ~/.polipo to configure your polipo instance.

  • There is another way that is not recommended. You can make your config file at /usr/local/etc/polipo/config and then create soft link to /etc/polipo/config with these commands:

    mkdir /usr/local/etc/polipo/
    curl -o /usr/local/etc/polipo/config https://raw.githubusercontent.com/jech/polipo/master/config.sample
    sudo ln -sfv /usr/local/etc/polipo/config /etc/polipo/config
    

    Then restart polipo and ensure that your config file location is correct. You can modify config file at /usr/local/etc/polipo/config.