
多功能跨平台网络工具Brook提供灵活控制
Brook是一款跨平台网络工具,支持iOS、Android、Mac、Windows、Linux和OpenWrt 等多种操作系统。它提供Fake DNS功能和可编程脚本接口,使用户能够精细控制网络请求和管理。Brook适用于各种网络环境,可用于优化网络性能和管理复杂的网络需求。
A cross-platform programmable network tool.
❤️ Shiliew - A network app designed for those who value their time
bash <(curl https://bash.ooo/nami.sh)
nami install brook
brook server -l :9999 -p hello
| iOS | Android | Mac | Windows | Linux | OpenWrt |
|---|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| / | / | App Mode | How | How | How |
You may want to use
brook linkto customize some parameters
Brook GUI will pass different global variables to the script at different times, and the script only needs to assign the processing result to the global variable out
Before discussing the GUI client, let's first talk about the command line client brook. As we know, after you have deployed the server, you can use the command line client brook to create a local socks5 proxy or http proxy on your machine, and then configure it in your system proxy settings or in your browser to use this proxy. However:
For the specifics of socks5 and http proxy, you can read this article.
The GUI client does not use socks5 and http proxy mode, so there is no issue with some software not using the system proxy. Instead, it uses a virtual network card to take over the entire system's network, including UDP-based http3. Moreover, Brook allows us to control network requests programmatically, so it is necessary to have basic knowledge of network requests.
Note: When we talk about addresses, we mean addresses that include the port number, such as a domain address:
google.com:443, or an IP address:8.8.8.8:53
google.com:4438.8.8.8:53, to inquire about the IP of google.com
google.com, such as 1.2.3.4, to the app1.2.3.4:4431.2.3.4:443In the above process, the app actually makes two network requests: one to the IP address 8.8.8.8:53 and another to the IP address 1.2.3.4:443. In other words, the domain name is essentially an alias for the IP, and must obtain the domain's IP to establish a connection.
Brook has a Fake DNS feature, which can parse the domain name out of the query requests that an app sends to the system DNS and decide how to respond to the app.
google.com:4438.8.8.8:53, to inquire about the IP of google.com8.8.8.8:53. <mark>This will trigger the in_dnsquery variable, carrying information such as domain</mark>
240.0.0.1240.0.0.1:443240.0.0.1:443240.0.0.1:443, discovers that this is a fake IP, and will convert the fake IP address back to the domain address google.com:443. <mark>This will trigger the in_address variable, carrying information such as domainaddress</mark>
google.com:443 to the Brook Servergoogle.com, such as receiving 1.2.3.41.2.3.4:4431.2.3.4:443 and returns the data to the Brook clientHowever, if the following situations occur, the domain name will not/cannot be parsed, meaning that the Brook client will not/cannot know what the domain name is and will treat it as a normal request sent to an IP address:
To avoid the ineffectiveness of Fake DNS, please refer to this article.
google.com:4438.8.8.8:53, to inquire about the IP of google.com8.8.8.8:53. <mark>This will trigger the in_address variable, carrying information such as ipaddress</mark>
8.8.8.8:53 to the Brook Server8.8.8.8:53 and returns the result, such as 1.2.3.4, to the Brook client1.2.3.4:4431.2.3.4:4431.2.3.4:443. <mark>This will trigger the in_address variable, carrying information such as ipaddress</mark>
1.2.3.4:443 to the Brook Server1.2.3.4:443 and returns the data to the Brook clientgoogle.com:4438.8.8.8:443, to inquire about the IP of google.com8.8.8.8:443. <mark>This will trigger the in_address variable, carrying information such as ipaddress</mark>
8.8.8.8:443 to the Brook Server8.8.8.8:443, and returns the result, such as 1.2.3.4, to the Brook client1.2.3.4:4431.2.3.4:4431.2.3.4:443. <mark>This will trigger the in_address variable, carrying information such as ipaddress</mark>
1.2.3.4:443 to the Brook Server1.2.3.4:443 and returns the data to the Brook clientTo avoid the ineffectiveness of Fake DNS, please refer to this article.
in_brooklinks variable is triggered:
in_dnsquery variable is triggered, you can process as needed, such as:
in_address variable is triggered, you can process as needed, such as:
in_httprequest and in_httpresponse.in_httprequest variable is triggered, you can process as needed, such as:
in_httpresponse variable is triggered, you can process as needed, such as:
For detailed information on the properties and responses of variables, please refer to the following content.
| variable | type | condition | timing | description | out type |
|---|---|---|---|---|---|
| in_brooklinks | map | / | Before connecting | Predefine multiple brook links, and then programmatically specify which one to connect to | map |
| in_dnsquery | map | FakeDNS: On | When a DNS query occurs | Script can decide how to handle this request | map |
| in_address | map | / | When connecting to an address | script can decide how to connect | map |
| in_httprequest | map | / | When an HTTP(S) request comes in | the script can decide how to handle this request | map |
| in_httprequest,in_httpresponse | map | / | when an HTTP(S) response comes in | the script can decide how to handle this response | map |
| Key | Type | Description | Example |
|---|---|---|---|
| _ | bool | meaningless | true |
out, ignored if not of type map
| Key | Type | Description | Example |
|---|---|---|---|
| ... | ... | ... | ... |
| custom name | string | brook link | brook://... |
| ... | ... | ... | ... |
| Key | Type | Description | Example |
|---|---|---|---|
| domain | string | domain name | google.com |
| type | string | query type | A |
| appid | string | App ID or path | com.google.Chrome.helper |
| interface | string | network interface. Mac only | en0 |
out, if it is error type will be recorded in the log. Ignored if not of type map
| Key | Type | Description | Example |
|---|---|---|---|
| block | bool | Whether Block, default false | false |
| ip | string | Specify IP directly, only valid when type is A/AAAA | 1.2.3.4 |
| system | bool | Resolve by System DNS, default false | false |
| bypass | bool | Resolve by Bypass DNS, default false | false |
| brooklinkkey | string | When need to connect the Server,instead, connect to the Server specified by the key in_brooklinks | custom name |
| Key | Type | Description | Example |
|---|---|---|---|
| network | string | Network type, the value tcp/udp | tcp |
| 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 |
| domainaddress | string | Domain type address, because of FakeDNS we can get the domain name address here | google.com:443 |
| appid | string | App ID or path | com.google.Chrome.helper |
| interface | string | network interface. Mac only | en0 |
out, if it is error type will be recorded in the log. Ignored if not of type map
| Key | Type | Description | Example |
|---|---|---|---|
| block | bool | Whether Block, default false | false |
| ipaddress | string | IP type address, rewrite destination | 1.2.3.4:443 |
| 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 |
| bypass | bool | Bypass, default false. If true and domainaddress, then ipaddress or ipaddressfrombypassdns must be specified | false |
| mitm | bool | Whether to perform MITM, default false. Only valid when network is tcp. Need to install CA, see below | false |
| mitmprotocol | string | MITM protocol needs to be specified explicitly, the value is http/https | https |
| 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 |
| mitmwithbody | bool | Whether to manipulate the http body, default false. will read the body of the request and response into the memory and interact with the script. iOS 50M total memory limit may kill process | false |
| mitmautohandlecompress | bool | Whether to automatically decompress the http body when interacting with the script, default false | false |
| mitmclienttimeout | int | Timeout for MITM talk to server, |


AI辅助编程,代码自动修复
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。


AI一键生成PPT,就用博思AIPPT!
博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。


AI赋能电商视觉革命,一站式智能商拍平台
潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。


企业专属的AI法律顾问
iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。


稳定高效的流量提升解决方案,助力品牌曝光
稳定高效的流量提升解决方案,助力品牌曝光


最新版Sora2模型免费使用,一键生成无水印视频
最新版Sora2模型免费使用,一键生成无水印视频


实时语音翻译/同声传译工具
Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。


选题、配图、成文,一站式创作,让内容运营更高效
讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。


最强AI数据分析助手
小 浣熊家族Raccoon,您的AI智能助手,致力于通过先进的人工智能技术,为用户提供高效、便捷的智能服务。无论是日常咨询还是专业问题解答,小浣熊都能以快速、准确的响应满足您的需求,让您的生活更加智能便捷。


像人一样思考的AI智能体
imini 是一款超级AI智能体,能根据人类指令,自主思考、自主完成、并且交付结果的AI智能体。
最新AI工具、AI资讯
独家AI资源、AI项目落地

微信扫一扫关注公众号