Code Monkey home page Code Monkey logo

proxy-toggle's Introduction

proxy-toggle

PyPi Version Build Status Coverage report Documentation Requirements Status

A command-line tool to run programs seamlessly behind a proxy.

Introduction

Many corporate networks use proxies both for network protection and to cache often-used content. This command-line tool allows you to run programs behind a corporate proxy without the need to constantly set/unset proxy environment variables. It sets the environment variables only when needed and unsets them whenever the program finished its execution. Currently, proxy-toggle only supports Basic Access Authentication as the authentication scheme to the proxy.

Deployment Requirements

In order to use this module you need to have access to a compatible version of the GnuPG executable. On a Linux platform, this will typically be installed via your distribution's package manager (e.g. apt-get on Debian/Ubuntu). Windows binaries are available here - use one of the gnupg-w32cli-1.4.x.exe installers for the simplest deployment options.

Installation

To use proxy-toggle:

$ pip install proxy-toggle

Head over to pip-installer for instructions on installing pip.

To run from source, you can download the source code for proxy-toggle, and then run:

$ python setup.py install

Usage

Before you can start using proxy-toggle, you must initialize the application:

$ px --init

This will prompt for your proxy settings: proxy server URL and user account/password. A secure keyring (to encrypt the password) will be generated. This might take a while.

You can test your proxy settings with following command:

$ px --test

After successful initialization, run:

$ px <program>

If your proxy doesn't require user authentication, run it with --nouser option:

$ px --nouser <program>

When you want to renew your proxy password, run it with --renew option:

$ px --renew

You can clear your proxy settings with --clear option:

$ px --clear

Examples

$ px git clone https://github.com/beylsp/proxy-toggle

$ px --nouser wget https://github.com/beylsp/archive/master.zip

Contributing

We love contributions. If you've found a bug in the tool or would like new features added, go ahead and open issues or pull requests against this repo. Write a test to show your bug was fixed or the feature works as expected.

proxy-toggle's People

Contributors

beylsp avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

pombredanne

proxy-toggle's Issues

init fail

C:>pip install --upgrade GnuPG
Requirement already up-to-date: GnuPG in c:\python27\lib\site-packages
Requirement already up-to-date: psutil>=1.2.1 in c:\python27\lib\site-packages (
from GnuPG)

C:>px --init
Please enter proxy host: a
Please enter proxy user: b
Please enter proxy password:
Error initializing keyring.
GnuPG is not installed!
Traceback (most recent call last):
File "C:\Python27\Scripts\px-script.py", line 9, in
load_entry_point('proxy-toggle==1.0.5', 'console_scripts', 'px')()
File "C:\Python27\lib\site-packages\proxytoggle\px.py", line 367, in main
init_proxy_store(config.renew)
File "C:\Python27\lib\site-packages\proxytoggle\px.py", line 52, in init
self._init_app()
File "C:\Python27\lib\site-packages\proxytoggle\px.py", line 76, in _init_app
sys.exit(err.errno)
AttributeError: 'exceptions.RuntimeError' object has no attribute 'errno'

gnupg or python-gnupg?

Hi Patrik,
thank you for your proxy-toggle package.
I'm trying to use it with Windows 10 as OS.
As long I can see, gnupg package has some problems with this OS, and maybe it is no longer mantained (55 Issues opened from 2013!).
Have you thought about using python-gnupg instead? I'm not sure, but this seems to be the original gnupg wrapper for python, and it works without problems.
I think that only few changes are required in your code to works with it.
Regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.