Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 35708  / 3 Years ago, tue, may 4, 2021, 11:16:28

Possible Duplicate:

How do I set systemwide proxy servers in Xubuntu, Lubuntu or Ubuntu Studio?






I'd like to built a script to switch the proxies between home and work. I know that you can set the wget proxy by using export http_proxy=proxy_address, but that's not the setting where the gui saves the setting to.



Chrome for example uses the setting I deployed under System settings -> Network -> Proxy. Where is this information saved?


More From » proxy

 Answers
4

I found the solution to my question just 2 days ago.



In order to be able to switch quickly between work and home, I wanted to write a script which changes my proxy configuration for all applications at once. Most of the applications were easy, they all had some kind of configuration file, for which I just created a copy to use for work and for home.



The system proxy however, is saved in gconf. To make switching easy, I went to the network settings, changed the proxy to manual and entered all my information for the proxy (host & port).



Then if I wanted to surf without proxy, I simply had to execute the following command:



gsettings set org.gnome.system.proxy mode 'none'



In order to switch back to the proxy connection I had to use the following command:



gsettings set org.gnome.system.proxy mode 'manual'



No need to specify host & port again, since those are already saved. If, however, you have to work with several proxies and would need to switch between different hosts, you can specify the proxy data with the following commands:



gsettings set org.gnome.system.proxy.http port 8080



gsettings set org.gnome.system.proxy.http host 172.16.1.1



Changes take effect immediately.



Source


[#36371] Wednesday, May 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
shionnky

Total Points: 276
Total Questions: 104
Total Answers: 108

Location: Montenegro
Member since Thu, Jun 16, 2022
2 Years ago
shionnky questions
;