This commit is contained in:
arraykeys
2023-04-27 17:04:31 +08:00
parent 544958c4d5
commit a318088821
4 changed files with 96 additions and 76 deletions
+41 -32
View File
@@ -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: The parameters are: --jumper, all the formats are as follows:
```text ```text
 http://username:password@host:port http://username:password@host:port
 http://host:port http://host:port
 https://username:password@host:port https://username:password@host:port
 https://host:port https://host:port
 socks5://username:password@host:port socks5://username:password@host:port
 socks5://host:port socks5://host:port
 socks5s://username:password@host:port socks5s://username:password@host:port
 socks5s://host:port socks5s://host:port
 ss://method:password@host:port ss://method:password@host:port
``` ```
Http,socks5 represents the normal http and socks5 proxy. 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. 4: The authentication information `auth-info-to-parent` that is finally sent to the upstream.
Their situation is as follows: Their situation is as follows:
User-auth | local-auth | parent-auth | auth-info-to-paren | User-auth | local-auth | parent-auth | auth-info-to-paren |
| ------ | ------ | ------ | ------ |-----------| ------ | ------ |--------------------- |
| Yes / No | Yes | Yes | From parent-auth | Yes / No | Yes | Yes | From parent-auth |
| Yes / No | No | Yes | From parent-auth | Yes / No | No | Yes | From parent-auth |
| Yes / No | Yes | No | No | Yes / No | Yes | No | No |
| No | No | No | No | No | No | No | No |
| Yes | No | No | From user-auth | 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. 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: "` `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. 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 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 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. For each connection that has been established, the proxy will `timely` report the traffic generated by this
`Timing` defaults to 5 seconds, and you can modify` Timing` to the appropriate number of seconds via the parameter `--traffic-interval`. 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, 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. 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`. In this mode, the reporting request method is `POST`, `Content-Type` is `application/json`, the post body data
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. 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: 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` `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: **Request parameter description:**
id: service id flag. `id`: service id flag.
server_addr: proxies's address requested by the client, format: IP: port. `server_addr`: proxies's address requested by the client, format: IP: port.
client_addr: client address, format: IP: port. `client_addr`: client address, format: IP: port.
target_addr: target address, format: "IP: port", when tcp / udp proxy, this is empty. `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. `username`: proxy authentication user name, this is empty when tcp / udp proxy.
bytes: the number of traffic bytes used by the user. `bytes`: the number of traffic bytes used by the user.
out_local_addr: outgoing tcp connection's local address,format: IP: port. `out_local_addr`: outgoing tcp connection's local address,format: IP: port.
out_remote_addr: outgoing tcp connection's remote 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. `upstream`: upstream used by outgoing tcp connection, if none upstream be used, it's empty.
#### Tips #### Tips
+3 -2
View File
@@ -2203,7 +2203,8 @@ proxy会把连接使用的流量上报到这个地址,具体情况是,proxy发
默认情况下,如果API接口处理并发能力不足,可以使用fast全局模式, 默认情况下,如果API接口处理并发能力不足,可以使用fast全局模式,
使用参数`--fast-global`开启,此参数只有`--traffic-mode=fast`的时候有效。fast全局模式,针对一个`--traffic-url` 使用参数`--fast-global`开启,此参数只有`--traffic-mode=fast`的时候有效。fast全局模式,针对一个`--traffic-url`
无论多少并发连接,只会开启一个定时上报,`定时`是5秒。 无论多少并发连接,只会开启一个定时上报,`定时`是5秒。
此模式下,上报请求方式是`POST`,`Content-Type`是`application/json`,数据是`JSON 数组`,示例:`[{},{}]`,数组里面的对象字段和下面的`请求参数说明`里面一致。 此模式下,上报请求方式是`POST`,`Content-Type`是`application/json`,数据是`JSON 数组`,示例:`[{},{}]`
,数组里面的对象字段和下面的`请求参数说明`里面一致。
4. 流量上报功能结合上面的API认证功能可以实现实时控制用户的流量使用,流量统计,流量限制;流量上报到接口,接口把流量数据写入数据库,然后认证API查询数据库判断用户或者IP流量使用情况,用来确定用户是否可以认证成功. 4. 流量上报功能结合上面的API认证功能可以实现实时控制用户的流量使用,流量统计,流量限制;流量上报到接口,接口把流量数据写入数据库,然后认证API查询数据库判断用户或者IP流量使用情况,用来确定用户是否可以认证成功.
下面是一个完整的URL请求实例: 下面是一个完整的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 `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=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标志。 id: 服务id标志。
server_addr: 客户端请求的代理地址,格式: `IP:端口`。 server_addr: 客户端请求的代理地址,格式: `IP:端口`。
client_addr: 客户端地址,格式: `IP:端口`。 client_addr: 客户端地址,格式: `IP:端口`。
+41 -32
View File
@@ -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: The parameters are: --jumper, all the formats are as follows:
```text ```text
 http://username:password@host:port http://username:password@host:port
 http://host:port http://host:port
 https://username:password@host:port https://username:password@host:port
 https://host:port https://host:port
 socks5://username:password@host:port socks5://username:password@host:port
 socks5://host:port socks5://host:port
 socks5s://username:password@host:port socks5s://username:password@host:port
 socks5s://host:port socks5s://host:port
 ss://method:password@host:port ss://method:password@host:port
``` ```
Http,socks5 represents the normal http and socks5 proxy. 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. 4: The authentication information `auth-info-to-parent` that is finally sent to the upstream.
Their situation is as follows: Their situation is as follows:
User-auth | local-auth | parent-auth | auth-info-to-paren | User-auth | local-auth | parent-auth | auth-info-to-paren |
| ------ | ------ | ------ | ------ |-----------| ------ | ------ |--------------------- |
| Yes / No | Yes | Yes | From parent-auth | Yes / No | Yes | Yes | From parent-auth |
| Yes / No | No | Yes | From parent-auth | Yes / No | No | Yes | From parent-auth |
| Yes / No | Yes | No | No | Yes / No | Yes | No | No |
| No | No | No | No | No | No | No | No |
| Yes | No | No | From user-auth | 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. 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: "` `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. 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 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 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. For each connection that has been established, the proxy will `timely` report the traffic generated by this
`Timing` defaults to 5 seconds, and you can modify` Timing` to the appropriate number of seconds via the parameter `--traffic-interval`. 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, 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. 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`. In this mode, the reporting request method is `POST`, `Content-Type` is `application/json`, the post body data
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. 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: 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` `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: **Request parameter description:**
id: service id flag. `id`: service id flag.
server_addr: proxies's address requested by the client, format: IP: port. `server_addr`: proxies's address requested by the client, format: IP: port.
client_addr: client address, format: IP: port. `client_addr`: client address, format: IP: port.
target_addr: target address, format: "IP: port", when tcp / udp proxy, this is empty. `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. `username`: proxy authentication user name, this is empty when tcp / udp proxy.
bytes: the number of traffic bytes used by the user. `bytes`: the number of traffic bytes used by the user.
out_local_addr: outgoing tcp connection's local address,format: IP: port. `out_local_addr`: outgoing tcp connection's local address,format: IP: port.
out_remote_addr: outgoing tcp connection's remote 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. `upstream`: upstream used by outgoing tcp connection, if none upstream be used, it's empty.
#### Tips #### Tips
+3 -2
View File
@@ -1982,7 +1982,8 @@ proxy会把连接使用的流量上报到这个地址,具体情况是,proxy发
默认情况下,如果API接口处理并发能力不足,可以使用fast全局模式, 默认情况下,如果API接口处理并发能力不足,可以使用fast全局模式,
使用参数`--fast-global`开启,此参数只有`--traffic-mode=fast`的时候有效。fast全局模式,针对一个`--traffic-url` 使用参数`--fast-global`开启,此参数只有`--traffic-mode=fast`的时候有效。fast全局模式,针对一个`--traffic-url`
无论多少并发连接,只会开启一个定时上报,`定时`是5秒。 无论多少并发连接,只会开启一个定时上报,`定时`是5秒。
此模式下,上报请求方式是`POST`,`Content-Type`是`application/json`,数据是`JSON 数组`,示例:`[{},{}]`,数组里面的对象字段和下面的`请求参数说明`里面一致。 此模式下,上报请求方式是`POST`,`Content-Type`是`application/json`,数据是`JSON 数组`,示例:`[{},{}]`
,数组里面的对象字段和下面的`请求参数说明`里面一致。
4. 流量上报功能结合上面的API认证功能可以实现实时控制用户的流量使用,流量统计,流量限制;流量上报到接口,接口把流量数据写入数据库,然后认证API查询数据库判断用户或者IP流量使用情况,用来确定用户是否可以认证成功. 4. 流量上报功能结合上面的API认证功能可以实现实时控制用户的流量使用,流量统计,流量限制;流量上报到接口,接口把流量数据写入数据库,然后认证API查询数据库判断用户或者IP流量使用情况,用来确定用户是否可以认证成功.
下面是一个完整的URL请求实例: 下面是一个完整的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 `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=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标志。 id: 服务id标志。
server_addr: 客户端请求的代理地址,格式: `IP:端口`。 server_addr: 客户端请求的代理地址,格式: `IP:端口`。
client_addr: 客户端地址,格式: `IP:端口`。 client_addr: 客户端地址,格式: `IP:端口`。