简单 TCP 路由代理:tproxy
tproxy 是简单 TCP 路由代理 (layer 7) ,基于 Gevent,可以使用 Python 配置路线逻辑。tproxy 灵感来源于 proxy machine,但是有一些独特的特性,比如 Gunicorn 的预先 fork 人工模式。
使用:
$ tproxy -h Usage: tproxy [OPTIONS] script_path Options: --version show program's version number and exit -h, --help show this help message and exit --log-file=FILE The log file to write to. [-] --log-level=LEVEL The granularity of log outputs. [info] --log-config=FILE The log config file to use. [None] -n STRING, --name=STRING A base to use with setproctitle for process naming. [None] -D, --daemon Daemonize the tproxy process. [False] -p FILE, --pid=FILE A filename to use for the PID file. [None] -u USER, --user=USER Switch worker processes to run as this user. [501] -g GROUP, --group=GROUP Switch worker process to run as this group. [20] -m INT, --umask=INT A bit mask for the file mode on files written by tproxy. [0] -b ADDRESS, --bind=ADDRESS The socket to bind. [127.0.0.1:8000] --backlog=INT The maximum number of pending connections. [2048] --ssl-keyfile=STRING Ssl key file [None] --ssl-certfile=STRING Ssl ca certs file. contains concatenated "certification [None] --ssl-ca-certs=STRING Ssl ca certs file. contains concatenated "certification [None] --ssl-cert-reqs=INT Specifies whether a certificate is required from the other [0] -w INT, --workers=INT The number of worker process for handling requests. [1] --worker-connections=INT The maximum number of simultaneous clients per worker. [1000] -t INT, --timeout=INT Workers silent for more than this many seconds are killed and restarted. [30]
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!