Skip to content

Commit cf0873e

Browse files
committed
update
1 parent 85cc445 commit cf0873e

File tree

4 files changed

+48
-8
lines changed

4 files changed

+48
-8
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,19 @@ Translation:
18341834
You can also use the parameter `--dns-interface` to specify the bandwidth used for dns resolution,
18351835
for example: `--dns-interface eth0`, dns resolution will use the eth0 bandwidth, this parameter must be set to `--dns-address` to be effective.
18361836

1837-
### 6.21 Help
1837+
### 6.21 Domain Name Sniffing
1838+
1839+
When a user client connects to the proxy using the SOCKS5 or HTTP proxy protocol, if the client connects with a domain name,
1840+
the client can choose to resolve the domain name locally or through the proxy. If the client resolves the domain name locally
1841+
and lets the proxy connect to the resolved IP, then the connection target obtained in the "API authentication" parameters will
1842+
be the IP or empty.
1843+
1844+
To avoid this situation, proxy provides a domain name sniffing feature. When the client connects to the SPS proxy, whether
1845+
through "HTTP proxy" or "SOCKS5 proxy", if the client accesses an http or https website, proxy will sniff the domain name
1846+
from the transmitted data. The sniffed domain name will be placed in the `sniff_domain` parameter of the "traffic reporting"
1847+
API, so the domain name can be obtained through the "traffic reporting" API.
1848+
1849+
### 6.22 Help
18381850

18391851
`proxy help sps`
18401852

@@ -2192,7 +2204,7 @@ There are two reporting modes, which can be specified by the `--traffic-mode` pa
21922204

21932205
The following is a complete URL request example:
21942206

2195-
`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`
2207+
`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&sniff_domain=myip.ipip.net`
21962208

21972209
**Request parameter description:**
21982210
`id`: service id flag.
@@ -2204,6 +2216,7 @@ The following is a complete URL request example:
22042216
`out_local_addr`: outgoing tcp connection's local address,format: IP: port.
22052217
`out_remote_addr`: outgoing tcp connection's remote address,format: IP: port.
22062218
`upstream`: upstream used by outgoing tcp connection, if none upstream be used, it's empty.
2219+
`sniff_domain`: This parameter is only available when the SPS function is enabled and the `--sniff-domain` option is used. The "sniff_domain" parameter is the sniffed domain name, in the format: domain or domain:port; this parameter only has a value when the client accesses an http/https URL, otherwise it is empty.
22072220

22082221
#### Tips
22092222

README_ZH.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,13 @@ iptables -t nat -A OUTPUT -p tcp -j PROXY
19641964

19651965
还可以用参数`--dns-interface`指定dns解析使用的网卡,比如:`--dns-interface eth0`,dns解析就会走eth0网卡,此参数必须设置`--dns-address`才有效。
19661966

1967-
### 6.21 查看帮助
1967+
### 6.21 嗅探域名
1968+
当用户客户端使用socks5代理或http代理协议连接代理的时候,客户端如果连接的是域名,这个时候客户端可以决定是本地解析域名还是通过代理解析域名,
1969+
如果客户端使用本地解析域名,然后让代理连接解析后的IP,那么“API认证”的参数里面拿到的连接目标就是IP或者空;
1970+
为了避免这种情况,proxy提供了一个域名嗅探功能,当客户端连接SPS代理的时候,无论是通过 “HTTP代理” 还是 “SOCKS5代理”,当客户端访问的是 http
1971+
或 https 网址的时候,proxy 都会嗅探传输数据中的域名,嗅探到的域名会放在“流量上报”接口的`sniff_domain`参数里面,这样就可以在“流量上报”接口获取域名。
1972+
1973+
### 6.22 查看帮助
19681974

19691975
`proxy help sps`
19701976

@@ -2299,7 +2305,7 @@ proxy会把连接使用的流量上报到这个地址,具体情况是,proxy发
22992305
下面是一个完整的URL请求实例:
23002306

23012307
`http://127.0.0.1:8080/auth.php?act=traffic&bytes=7627&client_addr=127.0.0.1%3A63637
2302-
&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`
2308+
&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&sniff_domain=www.baidu.com`
23032309

23042310
**请求参数说明**:
23052311
`id`: 服务id标志。
@@ -2311,6 +2317,7 @@ proxy会把连接使用的流量上报到这个地址,具体情况是,proxy发
23112317
`out_local_addr`: 代理对外建立的TCP连接的本地地址,格式: `IP:端口`
23122318
`out_remote_addr`: 代理对外建立的TCP连接的远程地址,格式: `IP:端口`
23132319
`upstream`: 使用的上级,格式是标准URL格式,如果没有使用上级,这里是空。
2320+
`sniff_domain`: 只有当 sps 功能,使用参数 `--sniff-domain` 开启了嗅探功能 ,才会有这个参数。参数“sniff_domain”是嗅探到的域名,格式:域名,或者: 域名:端口;只有在客户端访问的是 http/https 网址的时候这个参数才有值,其它情况为空。
23142321

23152322
#### 提示
23162323

docs/manual/manual.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,19 @@ Translation:
16361636
You can also use the parameter `--dns-interface` to specify the bandwidth used for dns resolution,
16371637
for example: `--dns-interface eth0`, dns resolution will use the eth0 bandwidth, this parameter must be set to `--dns-address` to be effective.
16381638

1639-
### 6.21 Help
1639+
### 6.21 Domain Name Sniffing
1640+
1641+
When a user client connects to the proxy using the SOCKS5 or HTTP proxy protocol, if the client connects with a domain name,
1642+
the client can choose to resolve the domain name locally or through the proxy. If the client resolves the domain name locally
1643+
and lets the proxy connect to the resolved IP, then the connection target obtained in the "API authentication" parameters will
1644+
be the IP or empty.
1645+
1646+
To avoid this situation, proxy provides a domain name sniffing feature. When the client connects to the SPS proxy, whether
1647+
through "HTTP proxy" or "SOCKS5 proxy", if the client accesses an http or https website, proxy will sniff the domain name
1648+
from the transmitted data. The sniffed domain name will be placed in the `sniff_domain` parameter of the "traffic reporting"
1649+
API, so the domain name can be obtained through the "traffic reporting" API.
1650+
1651+
### 6.22 Help
16401652

16411653
`proxy help sps`
16421654

@@ -1994,7 +2006,7 @@ There are two reporting modes, which can be specified by the `--traffic-mode` pa
19942006

19952007
The following is a complete URL request example:
19962008

1997-
`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`
2009+
`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&sniff_domain=myip.ipip.net`
19982010

19992011
**Request parameter description:**
20002012
`id`: service id flag.
@@ -2006,6 +2018,7 @@ The following is a complete URL request example:
20062018
`out_local_addr`: outgoing tcp connection's local address,format: IP: port.
20072019
`out_remote_addr`: outgoing tcp connection's remote address,format: IP: port.
20082020
`upstream`: upstream used by outgoing tcp connection, if none upstream be used, it's empty.
2021+
`sniff_domain`: This parameter is only available when the SPS function is enabled and the `--sniff-domain` option is used. The "sniff_domain" parameter is the sniffed domain name, in the format: domain or domain:port; this parameter only has a value when the client accesses an http/https URL, otherwise it is empty.
20092022

20102023
#### Tips
20112024

docs/manual/zh/manual.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,13 @@ iptables -t nat -A OUTPUT -p tcp -j PROXY
17371737

17381738
还可以用参数`--dns-interface`指定dns解析使用的网卡,比如:`--dns-interface eth0`,dns解析就会走eth0网卡,此参数必须设置`--dns-address`才有效。
17391739

1740-
### 6.21 查看帮助
1740+
### 6.21 嗅探域名
1741+
当用户客户端使用socks5代理或http代理协议连接代理的时候,客户端如果连接的是域名,这个时候客户端可以决定是本地解析域名还是通过代理解析域名,
1742+
如果客户端使用本地解析域名,然后让代理连接解析后的IP,那么“API认证”的参数里面拿到的连接目标就是IP或者空;
1743+
为了避免这种情况,proxy提供了一个域名嗅探功能,当客户端连接SPS代理的时候,无论是通过 “HTTP代理” 还是 “SOCKS5代理”,当客户端访问的是 http
1744+
或 https 网址的时候,proxy 都会嗅探传输数据中的域名,嗅探到的域名会放在“流量上报”接口的`sniff_domain`参数里面,这样就可以在“流量上报”接口获取域名。
1745+
1746+
### 6.22 查看帮助
17411747

17421748
`proxy help sps`
17431749

@@ -2072,7 +2078,7 @@ proxy会把连接使用的流量上报到这个地址,具体情况是,proxy发
20722078
下面是一个完整的URL请求实例:
20732079

20742080
`http://127.0.0.1:8080/auth.php?act=traffic&bytes=7627&client_addr=127.0.0.1%3A63637
2075-
&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`
2081+
&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&sniff_domain=www.baidu.com`
20762082

20772083
**请求参数说明**:
20782084
`id`: 服务id标志。
@@ -2084,6 +2090,7 @@ proxy会把连接使用的流量上报到这个地址,具体情况是,proxy发
20842090
`out_local_addr`: 代理对外建立的TCP连接的本地地址,格式: `IP:端口`
20852091
`out_remote_addr`: 代理对外建立的TCP连接的远程地址,格式: `IP:端口`
20862092
`upstream`: 使用的上级,格式是标准URL格式,如果没有使用上级,这里是空。
2093+
`sniff_domain`: 只有当 sps 功能,使用参数 `--sniff-domain` 开启了嗅探功能 ,才会有这个参数。参数“sniff_domain”是嗅探到的域名,格式:域名,或者: 域名:端口;只有在客户端访问的是 http/https 网址的时候这个参数才有值,其它情况为空。
20872094

20882095
#### 提示
20892096

0 commit comments

Comments
 (0)