Skip to main content

Python package which builds on pypac to add pac file support for httplib2 Http

Project description

pypac4http2

Python package which builds on pypac to add pac file support for httplib2 Http

This package adds proxy auto configure pac support to the httplib2 library Http classby sub-classing the class and adding a new constructor parameter for a resolver class.

Installation

pip install pypac4http2

Usage

HttpPac Class

The HttpPac class extends httplib2.Http and automatically resolves the proxy for each request using a PAC file.

from pypac4http2 import HttpPac

# Automatically discover PAC using OS settings or WPAD
http = HttpPac()
response, content = http.request("http://example.org")

# Or specify a PAC URL
http = HttpPac(pac_url="http://internal.corp/proxy.pac")
response, content = http.request("http://example.org")

CLI Tool

The package includes a CLI tool pypac4http2 to resolve proxies for a given URL.

# Resolve proxy using OS auto-discovery
pypac4http2 https://google.com

# Resolve proxy using a specific PAC URL
pypac4http2 --pac-url http://example.com/proxy.pac https://google.com

Output Example:

Proxy choice: PROXY proxy.example.com:8080
{
  "target_url": "https://google.com",
  "pac_result": "PROXY proxy.example.com:8080",
  "proxy_info": {
    "proxy_type": "HTTP",
    "proxy_host": "proxy.example.com",
    "proxy_port": 8080
  }
}

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

pypac4http2-0.0.3.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypac4http2-0.0.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file pypac4http2-0.0.3.tar.gz.

File metadata

  • Download URL: pypac4http2-0.0.3.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pypac4http2-0.0.3.tar.gz
Algorithm Hash digest
SHA256 cda55bc1ce5f7b02e3ab0378b05f64976c1e95d4acae136c860aa68b5b608488
MD5 eca07f7b9c9f181b84f16e843a99e0eb
BLAKE2b-256 4dc97b31365f633558fe6b5d0b5b9e6390304974be797f22183d5758961d6ba6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypac4http2-0.0.3.tar.gz:

Publisher: publish.yml on MikeMoore63/pypac4http2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pypac4http2-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pypac4http2-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pypac4http2-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d635f86b54525b8001225e0f169005044654b6630eb16feb4e18bab34696d3a4
MD5 871a6c901824c17d96602ea7a8184cf0
BLAKE2b-256 dfbb520c90c872e2521249b168bdf653a6b7672d83df1dcf21620aad1babf382

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypac4http2-0.0.3-py3-none-any.whl:

Publisher: publish.yml on MikeMoore63/pypac4http2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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