Skip to content

Commit eccb0ac

Browse files
committed
v20240214
1 parent 8fa4c6e commit eccb0ac

12 files changed

+2584
-1211
lines changed

README.md

+681-23
Large diffs are not rendered by default.

cli/brook/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func main() {
5959
df := func() {}
6060
app := cli.NewApp()
6161
app.Name = "Brook"
62-
app.Version = "20240101"
62+
app.Version = "20240214"
6363
app.Usage = "A cross-platform programmable network tool"
6464
app.Authors = []*cli.Author{
6565
{

docs/build.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ cd ../../docs
2121
jb '$1`brook mdpage`.split("\n").filter(v=>!v.startsWith("[")).join("\n").replace("```\n```", "```\nbrook [全局参数] 子命令 [子命令参数]\n```").split("\n").forEach(v=> echo(v.startsWith("**") && !v.startsWith("**Usage") ? "- "+v : v))' >> ../readme.md
2222

2323
cat diagram.md >> ../readme.md
24+
cat example.md >> ../readme.md
25+
cat example-zh.md >> ../readme.md
2426

2527
markdown ../readme.md ./index.html
2628

2729
echo '# Brook' > _.md
28-
echo 'A cross-platform programmable network tool. 一个跨平台可编程网络工具' >> _.md
30+
echo 'A cross-platform programmable network tool' >> _.md
2931
echo '' >> _.md
3032
echo '# Sponsor' >> _.md
31-
echo '**❤️ [Shiliew - China Optimized VPN](https://www.txthinking.com/shiliew.html)**' >> _.md
33+
echo '**❤️ [Shiliew - China Optimized Network App](https://www.txthinking.com/shiliew.html)**' >> _.md
3234
mdtoc ../readme.md >> _.md
3335
cat ../readme.md >> _.md
3436
mv _.md ../readme.md

docs/example-zh.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# 例子
22

3-
<!--SIDEBAR-->
4-
<!--G-R3M673HK5V-->
5-
63
下面列举一些常用场景命令的例子, 注意自己替换示例中的 IP,端口,密码,域名,证书路径等参数
74

85
### 运行 brook server
@@ -265,10 +262,10 @@ echo nameserver 8.8.8.8 > /etc/resolv.conf
265262
```
266263

267264
```
268-
brook tproxy --link 'brook://...' --dnsListen :53
265+
brook tproxy --link 'brook://...' --dnsListen 192.168.1.2:53 --disableAAAA
269266
```
270267

271-
> 配置其他机器的网关和 DNS 为这台机器的 IP 即可
268+
替换 192.168.1.2 为你的 Linux 的IP. 配置其他机器的网关和 DNS 为这台机器的 IP 即可
272269

273270
### 官网原版 OpenWrt 图形客户端
274271

@@ -307,3 +304,5 @@ brook pac --listen 127.0.0.1:8080 --proxy 'SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.
307304
```
308305
brook pac --file proxy.pac --proxy 'SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT' --bypassDomainList ...
309306
```
307+
308+
### 例子不胜枚举,更多功能建议挨个看 CLI 文档的命令和参数吧,还有博客,YouTube 等...

docs/example.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Examples
22

3-
<!--SIDEBAR-->
4-
<!--G-R3M673HK5V-->
5-
63
List some examples of common scene commands, pay attention to replace the parameters such as IP, port, password, domain name, certificate path, etc. in the example by yourself
74

85
### Run brook server
@@ -265,10 +262,10 @@ echo nameserver 8.8.8.8 > /etc/resolv.conf
265262
```
266263

267264
```
268-
brook tproxy --link 'brook://...' --dnsListen :53
265+
brook tproxy --link 'brook://...' --dnsListen 192.168.1.2:53 --disableAAAA
269266
```
270267

271-
You may need to manually configure the computer or mobile gateway and DNS.
268+
Replace 192.168.1.2 with your Linux IP. You may need to manually configure the computer or mobile gateway and DNS.
272269

273270
### GUI for official OpenWrt
274271

@@ -307,3 +304,5 @@ brook pac --listen 127.0.0.1:8080 --proxy 'SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.
307304
```
308305
brook pac --file proxy.pac --proxy 'SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT' --bypassDomainList ...
309306
```
307+
308+
### There are countless examples; for more feature suggestions, it's best to look at the commands and parameters in the CLI documentation one by one, and blog, YouTube...

docs/gui-zh.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- [Shiliew](https://www.txthinking.com/shiliew.html)
77
- [tun2brook](https://github.com/txthinking/tun2brook)
88

9-
## Programmable
9+
## 编程
1010

1111
```
1212
Brook GUI 会在不同时机向脚本传入不同的全局变量,脚本只需要将处理结果赋值到全局变量 out 即可
@@ -42,19 +42,18 @@ Brook GUI 会在不同时机向脚本传入不同的全局变量,脚本只需
4242
| ------ | ------ | -------- | ---------- |
4343
| domain | string | 域名 | google.com |
4444
| type | string | 查询类型 | A |
45-
| appid | string | App ID. 仅 Mac | com.google.Chrome.helper |
45+
| appid | string | App ID 或路径 | com.google.Chrome.helper |
4646
| interface | string | 网络接口. 仅 Mac | en0 |
4747

4848
`out`, 如果是 `error` 类型会被记录在日志。如果不是 `map` 类型则会被忽略
4949

5050
| Key | 类型 | 描述 | 示例 |
5151
| ------------ | ------ | -------------------------------------------------------------------------------------------------- | ------- |
52-
| block | bool | 是否 Block, 默认 `false`. 与 GUI Block Domain 是或的关系 | false |
52+
| block | bool | 是否 Block, 默认 `false` | false |
5353
| ip | string | 直接指定 IP,仅当 `type``A`/`AAAA`有效 | 1.2.3.4 |
54-
| forcefakedns | bool | 忽略 GUI Bypass Domain,使用 Fake DNS 来处理,仅当 `type``A`/`AAAA`有效,默认 `false` | false |
5554
| system | bool | 使用 System DNS 来解析,默认 `false` | false |
56-
| bypass | bool | 是否 Bypass, 默认 `false`, 如果为 `true` 则使用 Bypass DNS 来解析. 与 GUI Bypass Domain 是或的关系 | false |
57-
| brooklinkkey | string | 当需要连接代理服务器时,转而连接 通过 in_brooklinks 的 key 指定的 brook link | 自定义名字 |
55+
| bypass | bool | 使用 Bypass DNS 来解析,默认 `false` | false |
56+
| brooklinkkey | string | 当需要连接代理服务器时,转而连接 通过 in_brooklinks 的 key 指定的代理服务器 | 自定义名字 |
5857

5958
### in_address
6059

@@ -63,7 +62,7 @@ Brook GUI 会在不同时机向脚本传入不同的全局变量,脚本只需
6362
| network | string | 即将发起连接网络,取值 `tcp`/`udp` | tcp |
6463
| ipaddress | string | IP 类型的地址,与 domainaddress 只会存在一个。注意这两个之间没有任何关系 | 1.2.3.4:443 |
6564
| domainaddress | string | 域名类型的地址,因为 FakeDNS 我们这里才能拿到域名地址 | google.com:443 |
66-
| appid | string | App ID. 仅 Mac | com.google.Chrome.helper |
65+
| appid | string | App ID 或路径 | com.google.Chrome.helper |
6766
| interface | string | 网络接口. 仅 Mac | en0 |
6867

6968
`out`, 如果是 `error` 类型会被记录在日志。如果不是 `map` 类型则会被忽略
@@ -73,7 +72,7 @@ Brook GUI 会在不同时机向脚本传入不同的全局变量,脚本只需
7372
| block | bool | 是否 Block, 默认 `false` | false |
7473
| ipaddress | string | IP 类型地址,重写目的地 | 1.2.3.4:443 |
7574
| ipaddressfrombypassdns | string | 使用 Bypass DNS 获取`A``AAAA` IP 并重写目的地, 仅当 `domainaddress` 存在时有效,取值 `A`/`AAAA` | A |
76-
| bypass | bool | 是否 Bypass, 默认 `false`. 如果为 `true` 并且是 `domainaddress`, 那么必须指定 `ipaddress``ipaddressfrombypassdns`. 与 GUI Bypass IP 是或的关系 | false |
75+
| bypass | bool | 是否 Bypass, 默认 `false`. 如果为 `true` 并且是 `domainaddress`, 那么必须指定 `ipaddress``ipaddressfrombypassdns` | false |
7776
| mitm | bool | 是否进行 MITM, 默认 `false`. 仅当 `network``tcp` 时有效. 需要安装 CA,看下文介绍 | false |
7877
| mitmprotocol | string | 需要明确指定 MITM 协议, 取值 `http`/`https` | https |
7978
| mitmcertdomain | string | MITM 证书域名,默认从`domainaddress`里取。如果是 `ipaddress``mitm``true``mitmprotocol``https` 那么必须明确指定 | example.com |
@@ -82,7 +81,7 @@ Brook GUI 会在不同时机向脚本传入不同的全局变量,脚本只需
8281
| mitmclienttimeout | int | Timeout for MITM talk to server, second, default 0 | 0 |
8382
| mitmserverreadtimeout | int | Timeout for MITM read from client, second, default 0 | 0 |
8483
| mitmserverwritetimeout | int | Timeout for MITM write to client, second, default 0 | 0 |
85-
| brooklinkkey | string | 当需要连接代理服务器时,转而连接 通过 in_brooklinks 的 key 指定的 brook link | 自定义名字 |
84+
| brooklinkkey | string | 当需要连接代理服务器时,转而连接 通过 in_brooklinks 的 key 指定的代理服务器 | 自定义名字 |
8685

8786
### in_httprequest
8887

docs/gui.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,18 @@ Brook GUI will pass different global variables to the script at different times,
4242
| ------ | ------ | ----------- | ---------- |
4343
| domain | string | domain name | google.com |
4444
| type | string | query type | A |
45-
| appid | string | App ID. Mac only | com.google.Chrome.helper |
45+
| appid | string | App ID or path | com.google.Chrome.helper |
4646
| interface | string | network interface. Mac only | en0 |
4747

4848
`out`, if it is `error` type will be recorded in the log. Ignored if not of type `map`
4949

5050
| Key | Type | Description | Example |
5151
| ------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------- | ------- |
52-
| block | bool | Whether Block, default `false`. It is an OR relationship with GUI Block Domain | false |
52+
| block | bool | Whether Block, default `false` | false |
5353
| ip | string | Specify IP directly, only valid when `type` is `A`/`AAAA` | 1.2.3.4 |
54-
| forcefakedns | bool | Ignore GUI Bypass Domain, handle with Fake DNS, only valid when `type` is `A`/`AAAA`, default `false` | false |
55-
| system | bool | Get IP from system DNS, default `false` | false |
56-
| bypass | bool | whether to Bypass, default `false`, if `true` then use bypass DNS to resolve. It is an OR relationship with GUI Bypass Domain | false |
57-
| brooklinkkey | string | When need to connect the Server,instead, connect to the brook link specified by the key in_brooklinks | custom name |
54+
| system | bool | Resolve by System DNS, default `false` | false |
55+
| bypass | bool | Resolve by Bypass DNS, default `false` | false |
56+
| brooklinkkey | string | When need to connect the Server,instead, connect to the Server specified by the key in_brooklinks | custom name |
5857

5958
### in_address
6059

@@ -63,7 +62,7 @@ Brook GUI will pass different global variables to the script at different times,
6362
| network | string | Network type, the value `tcp`/`udp` | tcp |
6463
| ipaddress | string | IP type address. There is only of ipaddress and domainaddress. Note that there is no relationship between these two | 1.2.3.4:443 |
6564
| domainaddress | string | Domain type address, because of FakeDNS we can get the domain name address here | google.com:443 |
66-
| appid | string | App ID. Mac only | com.google.Chrome.helper |
65+
| appid | string | App ID or path | com.google.Chrome.helper |
6766
| interface | string | network interface. Mac only | en0 |
6867

6968
`out`, if it is `error` type will be recorded in the log. Ignored if not of type `map`
@@ -73,7 +72,7 @@ Brook GUI will pass different global variables to the script at different times,
7372
| block | bool | Whether Block, default `false` | false |
7473
| ipaddress | string | IP type address, rewrite destination | 1.2.3.4:443 |
7574
| ipaddressfrombypassdns | string | Use Bypass DNS to obtain `A` or `AAAA` IP and rewrite the destination, only valid when `domainaddress` exists, the value `A`/`AAAA` | A |
76-
| bypass | bool | Bypass, default `false`. If `true` and `domainaddress`, then `ipaddress` or `ipaddressfrombypassdns` must be specified. It is an OR relationship with GUI Bypass IP | false |
75+
| bypass | bool | Bypass, default `false`. If `true` and `domainaddress`, then `ipaddress` or `ipaddressfrombypassdns` must be specified | false |
7776
| mitm | bool | Whether to perform MITM, default `false`. Only valid when `network` is `tcp`. Need to install CA, see below | false |
7877
| mitmprotocol | string | MITM protocol needs to be specified explicitly, the value is `http`/`https` | https |
7978
| mitmcertdomain | string | The MITM certificate domain name, which is taken from `domainaddress` by default. If `ipaddress` and `mitm` is `true` and `mitmprotocol` is `https` then must be must be specified explicitly | example.com |
@@ -82,7 +81,7 @@ Brook GUI will pass different global variables to the script at different times,
8281
| mitmclienttimeout | int | Timeout for MITM talk to server, second, default 0 | 0 |
8382
| mitmserverreadtimeout | int | Timeout for MITM read from client, second, default 0 | 0 |
8483
| mitmserverwritetimeout | int | Timeout for MITM write to client, second, default 0 | 0 |
85-
| brooklinkkey | string | When need to connect the Server,instead, connect to the brook link specified by the key in_brooklinks | custom name |
84+
| brooklinkkey | string | When need to connect the Server,instead, connect to the Server specified by the key in_brooklinks | custom name |
8685

8786
### in_httprequest
8887

0 commit comments

Comments
 (0)