From 2d3ed37feb9caae8aafc0c84d4ebc3cb55b71c67 Mon Sep 17 00:00:00 2001 From: esrrhs Date: Sun, 23 Feb 2020 16:47:41 +0800 Subject: [PATCH] add --- README.md | 82 ++++++++++++++++++++++++++++++---------------------- README_EN.md | 28 +++++++++++++----- main.go | 40 +++++++++++++++++-------- 3 files changed, 95 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 8bf3ee6..2115bf3 100644 --- a/README.md +++ b/README.md @@ -116,48 +116,60 @@ QT GUI: https://github.com/esrrhs/pingtunnel-qt pingtunnel -type client -l LOCAL_IP:4455 -s SERVER_IP -sock5 1 -type 服务器或者客户端 - - -l 本地的地址,发到这个端口的流量将转发到服务器 - - -s 服务器的地址,流量将通过隧道转发到这个服务器 - - -t 远端服务器转发的目的地址,流量将转发到这个地址 - - -timeout 本地记录连接超时的时间,单位是秒,默认60s - + + server端参数: + -key 设置的密码,默认0 - - -tcp 设置是否转发tcp,默认0 - - -tcp_bs tcp的发送接收缓冲区大小,默认1MB - - -tcp_mw tcp的最大窗口,默认10000 - - -tcp_rst tcp的超时发送时间,默认400ms - - -tcp_gz 当数据包超过这个大小,tcp将压缩数据,0表示不压缩,默认0 - - -tcp_stat 打印tcp的监控,默认0 - + -nolog 不写日志文件,只打印标准输出,默认0 - + -noprint 不打印屏幕输出,默认0 - + -loglevel 日志文件等级,默认info - - -sock5 开启sock5转发,默认0 - - -maxconn 最大连接数,默认1000 - + + -maxconn 最大连接数,默认0,不受限制 + -maxprt server最大处理线程数,默认100 - + -maxprb server最大处理线程buffer数,默认1000 - - -profile 在指定端口开启性能检测,默认0不开启 - + -conntt server发起连接到目标地址的超时时间,默认1000ms - + + 客户端参数: + + -l 本地的地址,发到这个端口的流量将转发到服务器 + + -s 服务器的地址,流量将通过隧道转发到这个服务器 + + -t 远端服务器转发的目的地址,流量将转发到这个地址 + + -timeout 本地记录连接超时的时间,单位是秒,默认60s + + -key 设置的密码,默认0 + + -tcp 设置是否转发tcp,默认0 + + -tcp_bs tcp的发送接收缓冲区大小,默认1MB + + -tcp_mw tcp的最大窗口,默认10000 + + -tcp_rst tcp的超时发送时间,默认400ms + + -tcp_gz 当数据包超过这个大小,tcp将压缩数据,0表示不压缩,默认0 + + -tcp_stat 打印tcp的监控,默认0 + + -nolog 不写日志文件,只打印标准输出,默认0 + + -noprint 不打印屏幕输出,默认0 + + -loglevel 日志文件等级,默认info + + -sock5 开启sock5转发,默认0 + + -profile 在指定端口开启性能检测,默认0不开启 + -s5filter sock5模式设置转发过滤,默认全转发,设置CN代表CN地区的直连不转发 - + -s5ftfile sock5模式转发过滤的数据文件,默认读取当前目录的GeoLite2-Country.mmdb diff --git a/README_EN.md b/README_EN.md index 3b72101..7f9eb51 100644 --- a/README_EN.md +++ b/README_EN.md @@ -109,6 +109,26 @@ QT GUI: https://github.com/esrrhs/pingtunnel-qt -type client or server + server param: + + -key Set password, default 0 + + -nolog Do not write log files, only print standard output, default 0 is off + + -noprint Do not print standard output, default 0 is off + + -loglevel log level, default is info + + -maxconn the max num of connections, default 0 is no limit + + -maxprt max process thread in server, default 100 + + -maxprb max process thread's buffer in server, default 1000 + + -conntt The timeout period for the server to initiate a connection to the destination address. The default is 1000ms. + + client param: + -l Local address, traffic sent to this port will be forwarded to the server -s The address of the server, the traffic will be forwarded to this server through the tunnel @@ -139,16 +159,8 @@ QT GUI: https://github.com/esrrhs/pingtunnel-qt -sock5 Turn on sock5 forwarding, default 0 is off - -maxconn the max num of connections, default 1000 - - -maxprt max process thread in server, default 100 - - -maxprb max process thread's buffer in server, default 1000 - -profile Enable performance detection on the specified port. The default 0 is not enabled. - -conntt The timeout period for the server to initiate a connection to the destination address. The default is 1000ms. - -s5filter Set the forwarding filter in the sock5 mode. The default is full forwarding. For example, setting the CN indicates that the Chinese address is not forwarded. -s5ftfile The data file in sock5 filter mode, the default reading of the current directory GeoLite2-Country.mmdb diff --git a/main.go b/main.go index df62dd1..649f995 100644 --- a/main.go +++ b/main.go @@ -35,6 +35,34 @@ Usage: -type 服务器或者客户端 client or server +server端参数server param: + + -key 设置的密码,默认0 + Set password, default 0 + + -nolog 不写日志文件,只打印标准输出,默认0 + Do not write log files, only print standard output, default 0 is off + + -noprint 不打印屏幕输出,默认0 + Do not print standard output, default 0 is off + + -loglevel 日志文件等级,默认info + log level, default is info + + -maxconn 最大连接数,默认0,不受限制 + the max num of connections, default 0 is no limit + + -maxprt server最大处理线程数,默认100 + max process thread in server, default 100 + + -maxprb server最大处理线程buffer数,默认1000 + max process thread's buffer in server, default 1000 + + -conntt server发起连接到目标地址的超时时间,默认1000ms + The timeout period for the server to initiate a connection to the destination address. The default is 1000ms. + +客户端参数client param: + -l 本地的地址,发到这个端口的流量将转发到服务器 Local address, traffic sent to this port will be forwarded to the server @@ -80,21 +108,9 @@ Usage: -sock5 开启sock5转发,默认0 Turn on sock5 forwarding, default 0 is off - -maxconn 最大连接数,默认0,不受限制 - the max num of connections, default 0 is no limit - - -maxprt server最大处理线程数,默认100 - max process thread in server, default 100 - - -maxprb server最大处理线程buffer数,默认1000 - max process thread's buffer in server, default 1000 - -profile 在指定端口开启性能检测,默认0不开启 Enable performance detection on the specified port. The default 0 is not enabled. - -conntt server发起连接到目标地址的超时时间,默认1000ms - The timeout period for the server to initiate a connection to the destination address. The default is 1000ms. - -s5filter sock5模式设置转发过滤,默认全转发,设置CN代表CN地区的直连不转发 Set the forwarding filter in the sock5 mode. The default is full forwarding. For example, setting the CN indicates that the Chinese address is not forwarded.