github txthinking/brook v20240404

latest release: v20240606
2 months ago

Brook v20240404: Speed limit, IP count limit, Traffic statistics, Configure file

CLI

contains some experimental features

  • brook --speedLimit: Limit speed (b), such as 500kb/s: 500000, works with server/wsserver/wssserver/quicserver
  • brook --ipLimitMax: Limit the number of client IP addresses, be careful when using this parameter, as the client may have dynamic IP. Works with server/wsserver/wssserver/quicserver
  • brook --ipLimitInterval: Interval (s) for ipLimitMax
  • brook --ipLimitWait: How long (s) to wait for recovery after exceeding ipLimitMax
  • brook relayoverbrook --link
  • brook dnsserveroverbrook --link
  • brook wssclient --link
  • brook link --fragment When server is brook wssserver, split the ClientHello into multiple fragments and then send them one by one with delays (millisecond). The format is min_length:max_length:min_delay:max_delay, cannot be zero, such as 50:100:10:50, Note that: Currently only supported by the brook CLI and tun2brook.
  • brook --serverLog: Enable server log, traffic and more. A valid value is file path or 'console'. Mutually exclusive with the --log parameter. Works with server/wsserver/wssserver/quicserver

--serverLog format

{"bytes":"2190","dst":"8.8.8.8:53","from":"34.105.110.232:49514","network":"tcp","time":"2024-02-26T09:56:12Z"}
{"bytes":"2237","dst":"8.8.8.8:53","from":"34.105.110.232:49331","network":"udp","time":"2024-02-26T09:57:12Z"}

You can tally traffic from --serverLog, for example by using a jb script to sum up the traffic from the /tmp/brook.log log file.

jb 'var s=0; read_file("/tmp/brook.log").trim().split("\n").map(v=>JSON.parse(v)).forEach(v=> s+= v.bytes ? parseInt(v.bytes) : 0); echo(s)'
  • Support CAC configure file

We known this:

brook server -l :9999 -p apple

Then, create a file /root/any_name:

server -l :9999 -p apple

We can run it like this:

brook /root/any_name

GUI:

  • New: Brook OpenWRT GUI
    • Installing an ipk will automatically install dependencies.
    • Connect and disconnect auto-configure OpenWRT, no need to manually configure some settings in OpenWRT as before.
    • And some optimizations.
  • bugfix

Other

  • IPvBar: Display domain, IP and IP location on Chrome

Comment


Brook v20240404: 限速,限制客户端 IP 数量,流量统计,配置文件

CLI

含一些实验性功能

  • brook --speedLimit: 服务端限速
  • brook --ipLimitMax: 限制客户端 IP 数量
  • brook --ipLimitInterval: 周期
  • brook --ipLimitWait: 周期内触及 --ipLimitMax 数量后等待多久恢复
  • brook relayoverbrook --link
  • brook dnsserveroverbrook --link
  • brook wssclient --link
  • brook link --fragment 当服务器是brook wssserver时,将ClientHello拆分成多个分片,然后逐个延迟发送(毫秒为单位)。格式为 min_length:max_length:min_delay:max_delay,值不能为零,例如 50:100:10:50。需要注意的是:目前仅由brook CLI和tun2brook支持。
  • brook --serverLog: 服务端日志,包含每个连接的流量统计

--serverLog 格式如下

{"bytes":"2190","dst":"8.8.8.8:53","from":"34.105.110.232:49514","network":"tcp","time":"2024-02-26T09:56:12Z"}
{"bytes":"2237","dst":"8.8.8.8:53","from":"34.105.110.232:49331","network":"udp","time":"2024-02-26T09:57:12Z"}

可以从 --serverLog 里统计流量,比如用 jb 脚本统计 /tmp/brook.log 日志里的流量总和

jb 'var s=0; read_file("/tmp/brook.log").trim().split("\n").map(v=>JSON.parse(v)).forEach(v=> s+= v.bytes ? parseInt(v.bytes) : 0); echo(s)'
  • 支持 CAC 配置文件

我们知道这样:

brook server -l :9999 -p apple

现在, 创建一个文件 /root/any_name:

server -l :9999 -p apple

我们就可以这样:

brook /root/any_name

GUI:

  • 新增:Brook OpenWRT 图形客户端
    • 安装 ipk 时会自动安装依赖
    • 连接和断开自动配置 OpenWRT,无需再向以前一样手动去 OpenWRT 里配置一些东西
    • 以及一些细节的优化
  • bugfix

周边

  • IPvBar:显示域名,IP,IP 归属地的浏览器扩展

讨论

Don't miss a new brook release

NewReleases is sending notifications on new releases.