Total Pageviews

Sunday, 1 September 2019

基于python的http代理服务器程序:proxy2

HTTP proxy in a single python script。

Features

  • easy to customize
  • require no external modules
  • support both of IPv4 and IPv6
  • support HTTP/1.1 Persistent Connection
  • support dynamic certificate generation for HTTPS intercept
This script works on Python 2.7. You need to install OpenSSL to intercept HTTPS connections.

Usage

Just run as a script:
$ python proxy2.py
Above command runs the proxy on localhost:8080. Verify it works by typing the below command on another terminal of the same host.
$ http_proxy=localhost:8080 curl http://www.example.com/
proxy2 is made for debugging/testing, so it only accepts connections from localhost.
To use another port, specify the port number as the first argument.

$ python proxy2.py 3128

from https://github.com/inaz2/proxy2

No comments:

Post a Comment