Skip to main content

No project description provided

Project description

pwproxy


基于playwright实现mitmproxy的核心功能:请求拦截,响应篡改

优点

  1. 基于playwright,直接调用本地浏览器,不用以设置代理的方式启动浏览器, mitmproxy必须以冷启动设置代理的方法启动本地浏览器才能实现拦截
  2. 不需要考虑安全证书的问题

安装

pip install pwproxy

使用


目录结构:
├─run.py
├─demo.py
# run.py
from pwproxy.run import Run

Run.run("demo.py", url="http://example.com/")
# demo.py
from playwright.sync_api import Route


def replace_resp(route: Route):
    if "http://example.com/" in route.request.url:
        response = route.fetch()
        body = response.text()
        body = body.replace("Example Domain", "Goodo")
        route.fulfill(
            body=body
        )

addons = [
    replace_resp
]

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

pwproxy-1.0.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

pwproxy-1.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file pwproxy-1.0.0.tar.gz.

File metadata

  • Download URL: pwproxy-1.0.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pwproxy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 953b41eb5d85bbd4a216d260b60a32126929919c9671aef33fed68492f4f2f83
MD5 f1fcb2adcdf5f723d5f8f35441fd21c6
BLAKE2b-256 f4ae673e34ebcd0d3d577dae820563ada3a1b2c8dad2d1e07fec51a52260754d

See more details on using hashes here.

File details

Details for the file pwproxy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pwproxy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pwproxy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27b7fdace600ce46aa922e8102c681c69414d4a379eae5ff0dda86da0e4173a0
MD5 af58632a1835722986f38aee4d8cfed8
BLAKE2b-256 47377e5bc0d1e971e1c1e46810d611c74e32930c618d425ec3a635aab738389f

See more details on using hashes here.

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