You are not logged in.

#1 2013-12-19 09:24:18

XenGi
Member
From: berlin, germany, europe, earth
Registered: 2013-02-23
Posts: 35
Website

[SOLVED] System wide proxy settings without gnome and kde

Hi,

this is my software stack:

  • linux

  • X

  • openbox

  • chromium

my university had the great idea to cencor and filter the internet so that students can't do bad stuff and besides that can't do anything at all. They even block ping and ssh connections.. but that's another story.

here are my problems with that:

chomium devs seem to live in a very small world in which only kde and gnome exist, because these envirenments are the only way to let chromium know that it should use a proxy server.
I've written a small script that works perfectly for most of my stuff. here it is:

$ cat ~/.proxyon
export http_proxy='proxy.fh-brandenburg.de:3128'
export https_proxy='proxy.fh-brandenburg.de:3128'
export ftp_proxy='ftp-proxy.fh-brandenburg.de:21'
export socks5_proxy='socks5-proxy.fh-brandenburg.de:1080'

export HTTP_PROXY=http_proxy
export HTTPS_PROXY=https_proxy
export FTP_PROXY=ftp_proxy
export SOCKS5_PROXY=socks5_proxy

gsettings set org.gnome.system.proxy autoconfig-url 'http://proxy.fh-brandenburg.de/proxy.pac'
gsettings set org.gnome.system.proxy mode 'manual'
gsettings set org.gnome.system.proxy.http enabled true
gsettings set org.gnome.system.proxy.http host 'proxy.fh-brandenburg.de'
gsettings set org.gnome.system.proxy.http port 3128
gsettings set org.gnome.system.proxy.https host 'proxy.fh-brandenburg.de'
gsettings set org.gnome.system.proxy.https port 3128
gsettings set org.gnome.system.proxy.ftp host 'ftp-proxy.fh-brandenburg.de'
gsettings set org.gnome.system.proxy.ftp port 21
gsettings set org.gnome.system.proxy.socks host 'socks5-proxy.fh-brandenburg.de'
gsettings set org.gnome.system.proxy.socks port 1080
gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '*.fh-brandenburg.de' ]"

to start chromium i've made another script to test the proxy behavier:

$ cat ~/start_chromium.sh
source ~/.proxyon && echo $http_proxy && chromium

This should work because I set every proxy variable I'm aware of and the script spits out the correct proxy server but chromium still don't uses any proxies. Does anyone have a solution to this? I'm out of ideas..

Last edited by XenGi (2020-07-18 00:22:58)


# got root?█

Offline

#2 2013-12-24 05:25:13

delta24
Member
Registered: 2013-08-07
Posts: 13

Re: [SOLVED] System wide proxy settings without gnome and kde

Try creating a script in /etc/profile.d named proxy.sh having all the proxy config.
I think the format should be   " export http_proxy='http://username:pass@proxy:port/' " and to set the capitalised proxy variable to $http_proxy variable.
And chmod a+x the script.

Ref: https://wiki.archlinux.org/index.php/pr … _variables

Last edited by delta24 (2013-12-24 05:26:25)

Offline

#3 2013-12-24 23:20:52

XenGi
Member
From: berlin, germany, europe, earth
Registered: 2013-02-23
Posts: 35
Website

Re: [SOLVED] System wide proxy settings without gnome and kde

delta24 wrote:

Try creating a script in /etc/profile.d named proxy.sh having all the proxy config.

The behavier I want to achieve is that I can hot swap proxy and non proxy networks without restarting the browser. This works under gnome because chromium reads the proxy config from gconf which gets updated on network change but this doesn't work without gnome.
Most of the time I'm on networks without proxies. Only in university I need them. A simple switch to activate them when needed would be nice.


# got root?█

Offline

#4 2013-12-25 11:40:44

delta24
Member
Registered: 2013-08-07
Posts: 13

Re: [SOLVED] System wide proxy settings without gnome and kde

You can switch using the `unset` command. If you require a more automated solution, make a script which unsets all proxy variables, put in your $PATH and alias it in your bashrc. Then you're good to go!

Offline

#5 2013-12-25 16:07:26

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: [SOLVED] System wide proxy settings without gnome and kde

This is not a solution, but as far as i know you can configure a proxy from within the application in firefox.

Offline

#6 2013-12-26 00:11:38

Thaodan
Member
From: Dortmund, Nordrein-Westfalen
Registered: 2012-04-28
Posts: 448

Re: [SOLVED] System wide proxy settings without gnome and kde

But you use GNOME see your script its all GNOME stuff.
You could use proxydriver.


Linux odin 3.13.1-pf #1 SMP PREEMPT Wed Mar 5 21:47:28 CET 2014 x86_64 GNU/Linux

Offline

#7 2013-12-26 11:40:28

MaxKh
Member
Registered: 2013-02-08
Posts: 7

Re: [SOLVED] System wide proxy settings without gnome and kde

I use the extension for Chromium to configure proxy profiles and URL-based switch rules:
https://chrome.google.com/webstore/deta … okoefdjegm

My default proxies are configured in /etc/environment

Offline

#8 2013-12-26 12:03:03

delta24
Member
Registered: 2013-08-07
Posts: 13

Re: [SOLVED] System wide proxy settings without gnome and kde

How I interpreted this, as you need proxy environment variables set to update the system [ wget], some CLI programs require an environment variable to run. Other proxy addons such as FoxyProxy, ProxySwitchy can be easily used if just want your browsers to switch proxy environments.

Offline

#9 2014-10-08 15:44:36

XenGi
Member
From: berlin, germany, europe, earth
Registered: 2013-02-23
Posts: 35
Website

Re: [SOLVED] System wide proxy settings without gnome and kde

My final solution was to switch to firefox when I needed a proxy. Never found a working solution to this. But not in university so I don't need this anymore and the firefox approach works quite well.


# got root?█

Offline

Board footer

Powered by FluxBB