diff --git a/README.md b/README.md index 209f2c5..e44c509 100644 --- a/README.md +++ b/README.md @@ -339,15 +339,15 @@ Http (s) agent, SPS agent, intranet penetration, tcp agent support the connectio The parameters are: --jumper, all the formats are as follows: ```text - http://username:password@host:port - http://host:port - https://username:password@host:port - https://host:port - socks5://username:password@host:port - socks5://host:port - socks5s://username:password@host:port - socks5s://host:port - ss://method:password@host:port +http://username:password@host:port +http://host:port +https://username:password@host:port +https://host:port +socks5://username:password@host:port +socks5://host:port +socks5s://username:password@host:port +socks5s://host:port +ss://method:password@host:port ``` Http,socks5 represents the normal http and socks5 proxy. @@ -1489,13 +1489,13 @@ Sps supports http(s)\socks5 proxy authentication, which can be cascaded and has 4: The authentication information `auth-info-to-parent` that is finally sent to the upstream. Their situation is as follows: -User-auth | local-auth | parent-auth | auth-info-to-paren -| ------ | ------ | ------ | ------ -| Yes / No | Yes | Yes | From parent-auth -| Yes / No | No | Yes | From parent-auth -| Yes / No | Yes | No | No -| No | No | No | No -| Yes | No | No | From user-auth +| User-auth | local-auth | parent-auth | auth-info-to-paren | +|-----------| ------ | ------ |--------------------- | +| Yes / No | Yes | Yes | From parent-auth | +| Yes / No | No | Yes | From parent-auth | +| Yes / No | Yes | No | No | +| No | No | No | No | +| Yes | No | No | From user-auth | For the sps proxy we can perform username and password authentication. The authenticated username and password can be specified on the command line. `proxy sps -S http -T tcp -P 127.0.0.1:8080 -t tcp -p ":33080" -a "user1:pass1:0:0:" -a "user2:pass2:0:0: "` @@ -2011,33 +2011,42 @@ The proxy will report the traffic used for this connection to this address.Speci There are two reporting modes, which can be specified by the `--traffic-mode` parameter. It can be reported in the normal mode or in the fast mode. 1. Report in `normal` normal mode - When the connection is released, the proxy will report the traffic used for this connection to this `--traffic-url` address. + When the connection is released, the proxy will report the traffic used for this connection to this `--traffic-url` + address. 2. Report in `fast` mode - For each connection that has been established, the proxy will `timely` report the traffic generated by this connection to this` --traffic-url` address. - `Timing` defaults to 5 seconds, and you can modify` Timing` to the appropriate number of seconds via the parameter `--traffic-interval`. + For each connection that has been established, the proxy will `timely` report the traffic generated by this + connection to this` --traffic-url` address. + `Timing` defaults to 5 seconds, and you can modify` Timing` to the appropriate number of seconds via the + parameter `--traffic-interval`. -3. Report in `fast` global mode +3. Report in `fast` global mode By default, if the API can't handle high concurrency report access, you can use the fast global mode, - Use the parameter `--fast-global` to open, this parameter is only valid when `--traffic-mode=fast`. In fast global mode, for a `--traffic-url`, + Use the parameter `--fast-global` to open, this parameter is only valid when `--traffic-mode=fast`. In fast global + mode, for a `--traffic-url`, no matter how many concurrent connections there are, only have one reporter, and the reporting interval is 5 seconds. - In this mode, the reporting request method is `POST`, `Content-Type` is `application/json`, the post body data is `JSON Array`, example: `[{},{}]`, the keys of object in the array are same with the following `Please parameter description`. -4. The traffic reporting function combined with the above API authentication function can control the user's traffic usage in real time. The traffic is reported to the interface. The interface writes the traffic data to the database, and then the authentication API queries the database to determine the traffic usage and determine whether the user can be successfully authenticated. + In this mode, the reporting request method is `POST`, `Content-Type` is `application/json`, the post body data + is `JSON Array`, example: `[{},{}]`, the keys of object in the array are same with the + following `Reqeust parameter description`. +4. The traffic reporting function combined with the above API authentication function can control the user's traffic + usage in real time. The traffic is reported to the interface. The interface writes the traffic data to the database, + and then the authentication API queries the database to determine the traffic usage and determine whether the user + can be successfully authenticated. The following is a complete URL request example: `http://127.0.0.1:33088/user/traffic?bytes=337&client_addr=127.0.0.1%3A51035&id=http&server_addr =127.0.0.1%3A33088&target_addr=myip.ipip.net%3A80&username=a` -Request parameter description: -id: service id flag. -server_addr: proxies's address requested by the client, format: IP: port. -client_addr: client address, format: IP: port. -target_addr: target address, format: "IP: port", when tcp / udp proxy, this is empty. -User name: proxy authentication user name, this is empty when tcp / udp proxy. -bytes: the number of traffic bytes used by the user. -out_local_addr: outgoing tcp connection's local address,format: IP: port. -out_remote_addr: outgoing tcp connection's remote address,format: IP: port. -upstream: upstream used by outgoing tcp connection, if none upstream be used, it's empty. +**Request parameter description:** +`id`: service id flag. +`server_addr`: proxies's address requested by the client, format: IP: port. +`client_addr`: client address, format: IP: port. +`target_addr`: target address, format: "IP: port", when tcp / udp proxy, this is empty. +`username`: proxy authentication user name, this is empty when tcp / udp proxy. +`bytes`: the number of traffic bytes used by the user. +`out_local_addr`: outgoing tcp connection's local address,format: IP: port. +`out_remote_addr`: outgoing tcp connection's remote address,format: IP: port. +`upstream`: upstream used by outgoing tcp connection, if none upstream be used, it's empty. #### Tips diff --git a/README_ZH.md b/README_ZH.md index 7cac789..4f7aa46 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -2198,12 +2198,13 @@ proxy会把连接使用的流量上报到这个地址,具体情况是,proxy发 2. `fast`快速模式上报 对已经建立的每个连接,proxy会`定时`把这个连接产生的流量上报到这个这个`--traffic-url`地址. `定时`默认是5秒,可以通过参数`--traffic-interval`修改`定时`为合适的秒数。 - 默认情况下,快速上报是单个TCP链接维度,定时上报的,也就是说有1000个TCP链接,那么就会有1000的并发上报 + 默认情况下,快速上报是单个TCP链接维度,定时上报的,也就是说有1000个TCP链接,那么就会有1000的并发上报 3. `fast`快速模式全局上报 默认情况下,如果API接口处理并发能力不足,可以使用fast全局模式, 使用参数`--fast-global`开启,此参数只有`--traffic-mode=fast`的时候有效。fast全局模式,针对一个`--traffic-url`, 无论多少并发连接,只会开启一个定时上报,`定时`是5秒。 - 此模式下,上报请求方式是`POST`,`Content-Type`是`application/json`,数据是`JSON 数组`,示例:`[{},{}]`,数组里面的对象字段和下面的`请求参数说明`里面一致。 + 此模式下,上报请求方式是`POST`,`Content-Type`是`application/json`,数据是`JSON 数组`,示例:`[{},{}]` + ,数组里面的对象字段和下面的`请求参数说明`里面一致。 4. 流量上报功能结合上面的API认证功能可以实现实时控制用户的流量使用,流量统计,流量限制;流量上报到接口,接口把流量数据写入数据库,然后认证API查询数据库判断用户或者IP流量使用情况,用来确定用户是否可以认证成功. 下面是一个完整的URL请求实例: @@ -2211,7 +2212,7 @@ proxy会把连接使用的流量上报到这个地址,具体情况是,proxy发 `http://127.0.0.1:8080/auth.php?act=traffic&bytes=7627&client_addr=127.0.0.1%3A63637 &id=http&out_local_addr=127.0.0.1%3A63640&out_remote_addr=127.0.0.1%3A63639 &server_addr=127.0.0.1%3A33080&target_addr=www.baidu.com%3A443 &upstream=http%3A%2F%2F127.0.0.1%3A3100&username=a` -请求参数说明: +**请求参数说明**: id: 服务id标志。 server_addr: 客户端请求的代理地址,格式: `IP:端口`。 client_addr: 客户端地址,格式: `IP:端口`。 @@ -2219,8 +2220,8 @@ target_addr: 目标地址,格式: `IP:端口`,tcp/udp代理时,这个是空。 username: 代理认证用户名,tcp/udp代理时,这个是空。 bytes: 此次使用的流量字节数。 out_local_addr: 代理对外建立的TCP连接的本地地址,格式: `IP:端口`。 -out_remote_addr: 代理对外建立的TCP连接的远程地址,格式: `IP:端口`。 -upstream: 使用的上级,格式是标准URL格式,如果没有使用上级,这里是空。 +out_remote_addr: 代理对外建立的TCP连接的远程地址,格式: `IP:端口`。 +upstream: 使用的上级,格式是标准URL格式,如果没有使用上级,这里是空。 #### 提示 diff --git a/docs/manual/manual.md b/docs/manual/manual.md index cb16bd9..01e2d2a 100644 --- a/docs/manual/manual.md +++ b/docs/manual/manual.md @@ -148,15 +148,15 @@ Http (s) agent, SPS agent, intranet penetration, tcp agent support the connectio The parameters are: --jumper, all the formats are as follows: ```text - http://username:password@host:port - http://host:port - https://username:password@host:port - https://host:port - socks5://username:password@host:port - socks5://host:port - socks5s://username:password@host:port - socks5s://host:port - ss://method:password@host:port +http://username:password@host:port +http://host:port +https://username:password@host:port +https://host:port +socks5://username:password@host:port +socks5://host:port +socks5s://username:password@host:port +socks5s://host:port +ss://method:password@host:port ``` Http,socks5 represents the normal http and socks5 proxy. @@ -1298,13 +1298,13 @@ Sps supports http(s)\socks5 proxy authentication, which can be cascaded and has 4: The authentication information `auth-info-to-parent` that is finally sent to the upstream. Their situation is as follows: -User-auth | local-auth | parent-auth | auth-info-to-paren -| ------ | ------ | ------ | ------ -| Yes / No | Yes | Yes | From parent-auth -| Yes / No | No | Yes | From parent-auth -| Yes / No | Yes | No | No -| No | No | No | No -| Yes | No | No | From user-auth +| User-auth | local-auth | parent-auth | auth-info-to-paren | +|-----------| ------ | ------ |--------------------- | +| Yes / No | Yes | Yes | From parent-auth | +| Yes / No | No | Yes | From parent-auth | +| Yes / No | Yes | No | No | +| No | No | No | No | +| Yes | No | No | From user-auth | For the sps proxy we can perform username and password authentication. The authenticated username and password can be specified on the command line. `proxy sps -S http -T tcp -P 127.0.0.1:8080 -t tcp -p ":33080" -a "user1:pass1:0:0:" -a "user2:pass2:0:0: "` @@ -1820,33 +1820,42 @@ The proxy will report the traffic used for this connection to this address.Speci There are two reporting modes, which can be specified by the `--traffic-mode` parameter. It can be reported in the normal mode or in the fast mode. 1. Report in `normal` normal mode - When the connection is released, the proxy will report the traffic used for this connection to this `--traffic-url` address. + When the connection is released, the proxy will report the traffic used for this connection to this `--traffic-url` + address. 2. Report in `fast` mode - For each connection that has been established, the proxy will `timely` report the traffic generated by this connection to this` --traffic-url` address. - `Timing` defaults to 5 seconds, and you can modify` Timing` to the appropriate number of seconds via the parameter `--traffic-interval`. + For each connection that has been established, the proxy will `timely` report the traffic generated by this + connection to this` --traffic-url` address. + `Timing` defaults to 5 seconds, and you can modify` Timing` to the appropriate number of seconds via the + parameter `--traffic-interval`. -3. Report in `fast` global mode +3. Report in `fast` global mode By default, if the API can't handle high concurrency report access, you can use the fast global mode, - Use the parameter `--fast-global` to open, this parameter is only valid when `--traffic-mode=fast`. In fast global mode, for a `--traffic-url`, + Use the parameter `--fast-global` to open, this parameter is only valid when `--traffic-mode=fast`. In fast global + mode, for a `--traffic-url`, no matter how many concurrent connections there are, only have one reporter, and the reporting interval is 5 seconds. - In this mode, the reporting request method is `POST`, `Content-Type` is `application/json`, the post body data is `JSON Array`, example: `[{},{}]`, the keys of object in the array are same with the following `Please parameter description`. -4. The traffic reporting function combined with the above API authentication function can control the user's traffic usage in real time. The traffic is reported to the interface. The interface writes the traffic data to the database, and then the authentication API queries the database to determine the traffic usage and determine whether the user can be successfully authenticated. + In this mode, the reporting request method is `POST`, `Content-Type` is `application/json`, the post body data + is `JSON Array`, example: `[{},{}]`, the keys of object in the array are same with the + following `Reqeust parameter description`. +4. The traffic reporting function combined with the above API authentication function can control the user's traffic + usage in real time. The traffic is reported to the interface. The interface writes the traffic data to the database, + and then the authentication API queries the database to determine the traffic usage and determine whether the user + can be successfully authenticated. The following is a complete URL request example: `http://127.0.0.1:33088/user/traffic?bytes=337&client_addr=127.0.0.1%3A51035&id=http&server_addr =127.0.0.1%3A33088&target_addr=myip.ipip.net%3A80&username=a` -Request parameter description: -id: service id flag. -server_addr: proxies's address requested by the client, format: IP: port. -client_addr: client address, format: IP: port. -target_addr: target address, format: "IP: port", when tcp / udp proxy, this is empty. -User name: proxy authentication user name, this is empty when tcp / udp proxy. -bytes: the number of traffic bytes used by the user. -out_local_addr: outgoing tcp connection's local address,format: IP: port. -out_remote_addr: outgoing tcp connection's remote address,format: IP: port. -upstream: upstream used by outgoing tcp connection, if none upstream be used, it's empty. +**Request parameter description:** +`id`: service id flag. +`server_addr`: proxies's address requested by the client, format: IP: port. +`client_addr`: client address, format: IP: port. +`target_addr`: target address, format: "IP: port", when tcp / udp proxy, this is empty. +`username`: proxy authentication user name, this is empty when tcp / udp proxy. +`bytes`: the number of traffic bytes used by the user. +`out_local_addr`: outgoing tcp connection's local address,format: IP: port. +`out_remote_addr`: outgoing tcp connection's remote address,format: IP: port. +`upstream`: upstream used by outgoing tcp connection, if none upstream be used, it's empty. #### Tips diff --git a/docs/manual/zh/manual.md b/docs/manual/zh/manual.md index deba5c3..c7af295 100644 --- a/docs/manual/zh/manual.md +++ b/docs/manual/zh/manual.md @@ -1977,12 +1977,13 @@ proxy会把连接使用的流量上报到这个地址,具体情况是,proxy发 2. `fast`快速模式上报 对已经建立的每个连接,proxy会`定时`把这个连接产生的流量上报到这个这个`--traffic-url`地址. `定时`默认是5秒,可以通过参数`--traffic-interval`修改`定时`为合适的秒数。 - 默认情况下,快速上报是单个TCP链接维度,定时上报的,也就是说有1000个TCP链接,那么就会有1000的并发上报 + 默认情况下,快速上报是单个TCP链接维度,定时上报的,也就是说有1000个TCP链接,那么就会有1000的并发上报 3. `fast`快速模式全局上报 默认情况下,如果API接口处理并发能力不足,可以使用fast全局模式, 使用参数`--fast-global`开启,此参数只有`--traffic-mode=fast`的时候有效。fast全局模式,针对一个`--traffic-url`, 无论多少并发连接,只会开启一个定时上报,`定时`是5秒。 - 此模式下,上报请求方式是`POST`,`Content-Type`是`application/json`,数据是`JSON 数组`,示例:`[{},{}]`,数组里面的对象字段和下面的`请求参数说明`里面一致。 + 此模式下,上报请求方式是`POST`,`Content-Type`是`application/json`,数据是`JSON 数组`,示例:`[{},{}]` + ,数组里面的对象字段和下面的`请求参数说明`里面一致。 4. 流量上报功能结合上面的API认证功能可以实现实时控制用户的流量使用,流量统计,流量限制;流量上报到接口,接口把流量数据写入数据库,然后认证API查询数据库判断用户或者IP流量使用情况,用来确定用户是否可以认证成功. 下面是一个完整的URL请求实例: @@ -1990,7 +1991,7 @@ proxy会把连接使用的流量上报到这个地址,具体情况是,proxy发 `http://127.0.0.1:8080/auth.php?act=traffic&bytes=7627&client_addr=127.0.0.1%3A63637 &id=http&out_local_addr=127.0.0.1%3A63640&out_remote_addr=127.0.0.1%3A63639 &server_addr=127.0.0.1%3A33080&target_addr=www.baidu.com%3A443 &upstream=http%3A%2F%2F127.0.0.1%3A3100&username=a` -请求参数说明: +**请求参数说明**: id: 服务id标志。 server_addr: 客户端请求的代理地址,格式: `IP:端口`。 client_addr: 客户端地址,格式: `IP:端口`。 @@ -1998,8 +1999,8 @@ target_addr: 目标地址,格式: `IP:端口`,tcp/udp代理时,这个是空。 username: 代理认证用户名,tcp/udp代理时,这个是空。 bytes: 此次使用的流量字节数。 out_local_addr: 代理对外建立的TCP连接的本地地址,格式: `IP:端口`。 -out_remote_addr: 代理对外建立的TCP连接的远程地址,格式: `IP:端口`。 -upstream: 使用的上级,格式是标准URL格式,如果没有使用上级,这里是空。 +out_remote_addr: 代理对外建立的TCP连接的远程地址,格式: `IP:端口`。 +upstream: 使用的上级,格式是标准URL格式,如果没有使用上级,这里是空。 #### 提示