/proxy_manager

script to turn on or off proxy for debian based systems such as ubuntu, raspberry,...

Primary LanguagePython

proxy_manager

script to turn on or off proxy for debian based systems such as ubuntu, raspberry,...

Install:

git clone https://github.com/Dragon2fly/proxy_manager.git
cp proxy_manager/proxy_manager.py . && rm -r -f proxy_manager/

or download https://github.com/Dragon2fly/proxy_manager/archive/master.zip and extract proxy_manager.py into your $HOME directory

Usage:

./proxy_manager.py cmd [proxy_address port] [no_proxy_address]

where:

  • cmd                         :on or off, turn on or off proxy
  • proxy_address       : addess of the proxy, not include http:// and similar
  • port                          : port of the proxy
  • no_proxy_address : address to be excluded from proxy

Example:

You have a proxy http://myproxy.com:8080

  • Set system wide proxy:
```
$ ./proxy_manager.py on myproxy.com 8080
```
  • You don't want to use this proxy on .mydomain.com, www.abc.com:
```
$ ./proxy_manager.py on myproxy.com 8080 .mydomain.com www.abc.com
```
  • You don't need proxy anymore:
```
$ ./proxy_manager.py off
```

Set default proxy:

  • Open proxy_manager.py for editing.

    $ gedit proxy_manager.py
    
  • Then replace these below lines

    addr0, port0 = '', ''
    exclude0 = ''
    
  • into:

    addr0, port0 = 'myproxy.com', '8080'
    exclude0 = '.mydomain.com,www.abc.com'
    
  • From now, you can turn on/off proxy just by

    $ ./proxy_manager.py on
    
  • If you put a proxy on command line, it will overwrite the default one.