Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to use a pac-file-url to set the web proxy rules for chromium in lubuntu. Chromium reads its settings from the system wide OS settings. I read How do I set systemwide proxy servers in Xubuntu, Lubuntu or Ubuntu Studio? but I am not clear on the following question.

How do I specify the pac-file-url in the system wide settings in lubuntu?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Here a several ways to do this.

Network based configurations

DHCP

If you are using DHCP, you can set here an option configuring your clients. For this specify in your dhcpd configuration:

option wpad-url  code 252 = text;
option wpad-url  "http://mywebserver/myconf.pac" ;

DNS

An alternate possibility is to use the DNS to specify the pac file.

See e.g. wikipedia

Before fetching its first page, a web browser implementing this method sends the local DHCP server a DHCPINFORM query, and uses the URL from the WPAD option in the server's reply. If the DHCP server does not provide the desired information, DNS is used. If, for example, the network name of the user's computer is pc.department.branch.example.com, the browser will try the following URLs in turn until it finds a proxy configuration file within the domain of the client:

http://wpad.department.branch.example.com/wpad.dat
http://wpad.branch.example.com/wpad.dat
http://wpad.example.com/wpad.dat
http://wpad.com/wpad.dat (in incorrect implementations, see note in Security below)

(Note: These are examples and may not be live URLs.)

Notes:

  • The wpad.dat file may be an symbolic link to the file used in the DHCP configuration.
  • The DNS based resolution has normally a lower priority as the DHCP based resolution.

System / user based configurations

system (or user) based configuration via environment variable

To use the pac file for curl and other programs you can set the environment variable auto_proxy. E.g.:

 auto_proxy=http://myserver/myconf.pac

user based configuration for applications using gconf

For adding the autoconfig url to your gconf settings you can use the following command:

gconftool-2 --set /system/proxy/autoconfig_url \
    --type string  ${auto_proxy}

lxproxy Utility for Lubuntu

Please see the community wiki. Here is the ppa for lxproxy referenced. Lxproxy claims to be a smlall gui to set a proxy server.

Application specific configuration

chromium

You may enforce that all chromium browser instances on a machine use the autoconfig url. Place a file (e.g. proxyConfig) below /etc/chromium-browser/policies/managed/ with the following content

      {
          "ProxyMode": "pac_script",
          "ProxyPacUrl": "http://myserver/myconfig.pac",
     }

Note: Placing this file below /etc/chromium-browser/policies/recommended will make this setting a default. The user is able to change this setting afterwards in his own chromium configuration.

firefox

Edit the file /etc/firefox/syspref.js and add the following lines

 lockPref("network.proxy.autoconfig_url", "http://myserver/myconfig.pac");
 lockPref("network.proxy.type", 2);

Alternate way: Set this values as user preferences via about:config.

thunderbird

Edit the file /etc/thunderbird/syspref.js and add the following lines

 pref("network.proxy.autoconfig_url", "http://myserver/myconfig.pac");
 pref("network.proxy.type", 2);

Note: Due to bug #1081015 you can't lock down this setting. So it is here only possible to set a default. Ensure that this values are note overwritten by prefs.js in your active profile.

share|improve this answer
    
Thanks for this. This is for chromium for my home PC. The dhcp server is just on my home router so I am not explicitly running dhcpd. Similarly for DNS, unless there is way to do this is in a normal home setup. Also, I am not sure lxproxy exists for 12.10 does it? See launchpad.net/~lubuntu-desktop/+archive/ppa/… . –  Raphael Mar 4 '13 at 7:54
    
Right - lxproxy is only available for 12.04. –  H.-Dirk Schmitt Mar 4 '13 at 9:56
    
As an alternative I added a section describing the lockdown of the autoconfig url for chromium. –  H.-Dirk Schmitt Mar 4 '13 at 9:57
    
@Raphael The command line option is disabled, because you put it in managed. Put it in recommended to make it a default value which can be overwritten by command line option or user configuration. –  H.-Dirk Schmitt Mar 8 '13 at 20:21
    
@Raphael Please double check the url - I can't see the a protocol, and the host name is curious. –  H.-Dirk Schmitt Mar 8 '13 at 20:22
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.