Skip to main content

Light weight auto proxy server

Project description

CircleCI PyPI version

State

In active development. It's in experiment state now

Python AutoProxy

pyautoproxy helps to configure your proxy for developemnt purpose. When you work with some proxy and have to validate traffic quite often it really annoying to reconfigure a device to use proxy when needed and when not to.

To make life a bit easier we can use Proxy Auto-Config. But problem with it is that most of http clients expect it to be on some server and response from that server should have proper headers, hence we can't use just a file on local machine. Also Different devices require different proxy config time by time.

This app can solve the issue above. It's simple http server which now start serve on specified port and return correct Auto-Config based on query parameters.

Usge

Install

pip install pyautoproxy

Run the server:

pyautoproxy --port 8081

For exanple, request to http://localhost:8081?host=localhost&port=8080 will return

function FindProxyForURL(url, host)
{
    return "PROXY localhost:8080; DIRECT";
}

Which means that when proxy on localhost:8080 is available a client will try use it, but when you turn it off it will bypass proxy and use direct connections.

iOS simulator

iOS simulator requires configure your Mac OS to use the proxy, which really annoying. But when you start pyautoproxy as

pyautoproxy -s

It will filter all requests except requests from iOS, hence all you machine traffic won't go through the proxy.

Configure for Android Emulator

From emulator you can always refer to host machine with ip 10.0.2.2. Usual link for Auto-Proxy config on Android will looks like http://10.0.2.2:8081/?host=10.0.2.2&port=8080

Configure proxy type

By default, proxy corresponding to the protocol of the original request, be it http, https, or ftp, is used.

If you want to change it, just add proxy parameter to the Auto-Config URL e.g.:

http://localhost:8081/?host=localhost&port=8080&proxy=SOCKS5

// Will return

function FindProxyForURL(url, host)
{
    return "SOCKS5 localhost:8080; DIRECT";
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyautoproxy-0.0.15.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

pyautoproxy-0.0.15-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pyautoproxy-0.0.15.tar.gz.

File metadata

  • Download URL: pyautoproxy-0.0.15.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.12

File hashes

Hashes for pyautoproxy-0.0.15.tar.gz
Algorithm Hash digest
SHA256 080fe96ce52706691e2b701485fc007999cc958210746e874615c8905f690b79
MD5 4bf337fdbd5fc1779f515e4d77d6c1c6
BLAKE2b-256 857896a2ee51cabcf3696564afe99bbfb4cf4dda44ed62332b4b8ff95363477d

See more details on using hashes here.

File details

Details for the file pyautoproxy-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: pyautoproxy-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.12

File hashes

Hashes for pyautoproxy-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 49222e59019e9b9515717da253c11022ed22e6eac3ed1bbda15f09bcf19f0dd2
MD5 92e356d3e902976eefea2c87be8cf7c1
BLAKE2b-256 0bfa078709a3bfa603941895fae2bee773f5ffc2b8a5f5d68e7417079e0b7a2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page