This module implements a tiny threaded HTTP proxy by extending HTTPServer
. Supports the GET
, HEAD
, POST
, PUT
, DELETE
and CONNECT
methods.
The latest version can be installed via PyPI:
$ pip install httproxy
or:
$ easy_install httproxy
The source code repository and issue tracker are maintained on GitHub.
Quickstart
Usage:
httproxy [options] httproxy [options] <allowed-client> ...
Options:
-h, --help Show this screen. --version Show version and exit. -H, --host HOST Host to bind to [default: 127.0.0.1]. -p, --port PORT Port to bind to [default: 8000]. -l, --logfile PATH Path to the logfile [default: STDOUT]. -i, --pidfile PIDFILE Path to the pidfile [default: httproxy.pid]. -d, --daemon Daemonize (run in the background). The default logfile path is httproxy.log in this case. -c, --configfile CONFIGFILE Path to a configuration file. -v, --verbose Log headers.
To start the proxy server and bind it to port 22222 (the port on which it will listen and accept connections):
httproxy --host 127.0.0.1 -p 22222
To start the proxy server, bind it to port 22222 and tell it to log all requests to the file httproxy.log
:
httproxy -p 22222 -l httproxy.log
To start the proxy server so it only allows connections from IP 123.123.123.123
:
httproxy 123.123.123.123
To start the proxy server bound to port 22222, log to file httproxy.log
and run the server in the background (as a daemon):
httproxy -p 22222 -l httproxy.log -d
from https://github.com/ambv/httproxy
这个http proxy server程序可用作各种tunnel程序(比如stunnel,kcptun)的后端程序。
No comments:
Post a Comment