How to configure w3m to use squid proxy (or any proxy) by default when invoked by a specific user

PROXYsquidw3m

Can I configure w3m to use Squid by default when invoked by a specific user in a bash login shell?

I've looked inside the w3m configuration file, but I don't see any setting were I can set squid as the default proxy.

Best Answer

You don't tell a browser to “use Squid” as a proxy, you tell it to use whatever proxy is running on a certain host and port.

Many web browsers, including w3m, can take proxy settings from the environment. Set the variable http_proxy, e.g.

export http_proxy=http://localhost:3128/

Put this line in that account's ~/.profile, or put the line http_proxy=http://localhost:3128/ in ~/.pam_environment.

If you want to proxy HTTPS as well, put a similar line with https_proxy.

Alternatively, you can configure the proxy in w3m's configuration file, with a line in ~/.w3m/config

http_proxy http://localhost:3128/

This option can be set interactively in the options screen (press o then type /proxyEnter and type the proxy URL in the box for “URL of HTTP proxy host”).

You may want to set no_proxy as well to exclude some domains, e.g. set to localhost,127.0.0.1.

Related Question