Picking up GNOME proxy settings

Porting applications to use DConf proxy settings

In GNOME 3, proxy configuration moved to the GSettings/dconf keys under org.gnome.system.proxy. You can examine them with the gsettings tool:

$ gsettings list-recursively org.gnome.system.proxy
org.gnome.system.proxy autoconfig-url ''
org.gnome.system.proxy ignore-hosts ['localhost', '']
org.gnome.system.proxy mode 'none'
org.gnome.system.proxy use-same-proxy true
org.gnome.system.proxy.ftp host ''
org.gnome.system.proxy.ftp port 0
org.gnome.system.proxy.http authentication-password ''
org.gnome.system.proxy.http authentication-user ''
org.gnome.system.proxy.http enabled false
org.gnome.system.proxy.http host ''
org.gnome.system.proxy.http port 8080
org.gnome.system.proxy.http use-authentication false
org.gnome.system.proxy.https host ''
org.gnome.system.proxy.https port 0
org.gnome.system.proxy.socks host ''
org.gnome.system.proxy.socks port 0


The best tool to use is the GProxyResolver API from GIO, introduced in GLib 2.26.

You might also choose to use the GSettings API directly, or call out to the gsettings tool as an external process. Bug 648237 gives more information on how the values should be interpreted. If you use the gsettings tool (which, for the record, we don't recommend), note that its output always includes quotes around string values:

$ gsettings get org.gnome.system.proxy.http host

At a higher level, the GIO networking APIs such as GSocketClient do this automatically.

DevGnomeOrg/Gnome3PortingGuide/ProxyConfiguration (last edited 2014-08-21 09:49:25 by DavidKing)