Skip to main content

Mitm proxy that defends against TLS and JS worker fingerprinting.

Project description

Python Usage

Usage

from hazetunnel import HazeTunnel
from browserforge.headers import HeaderGenerator
...
# Initialize the proxy
proxy = HazeTunnel(port='8080', payload='alert("Hello World!");')
proxy.launch()
# Send the request
requests.get(
    url='https://example.com',
    headers=HeaderGenerator().generate(browser='chrome'),
    proxies={'https': proxy.url},
    verify=proxy.cert
).text
# Stop the proxy
proxy.stop()
HazeTunnel parameters
Parameters:
    port (Optional[str]): Specify a port to listen on. Default is random.
    payload (Optional[str]): Payload to inject into responses
    user_agent (Optional[str]): Optionally override all User-Agent headers
    upstream_proxy (Optional[str]): Optionally forward requests to an upstream proxy

Using a context manager

A context manager will automatically close the server when not needed anymore.

with HazeTunnel(port='8080', payload='alert("Hello World!");') as proxy:
  # Send the request
  requests.get(
      url='https://example.com',
      headers=HeaderGenerator().generate(browser='chrome'),
      proxies={'https': proxy.url},
      verify=proxy.cert
  ).text

CLI

Download the latest version of the API:

python -m hazetunnel fetch

Remove all files before uninstalling

python -m hazetunnel remove

Run the MITM proxy:

python -m hazetunnel run -p 8080 --verbose

All commands

Usage: python -m hazetunnel [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  fetch    Fetch the latest version of hazetunnel-api
  remove   Remove all library files
  run      Run the MITM proxy
  version  Display the current version

See here for more information and examples.


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

hazetunnel-2.0.1.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

hazetunnel-2.0.1-py3-none-any.whl (9.4 kB view hashes)

Uploaded Python 3

Supported by

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