Skip to content

Commit dde0f08

Browse files
committed
v20230401
1 parent c29c504 commit dde0f08

File tree

4 files changed

+55
-73
lines changed

4 files changed

+55
-73
lines changed

docs/cli.md

Lines changed: 52 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ Brook - A cross-platform network tool designed for developers
77
Brook
88

99
```
10+
[--dialWithIP4]=[value]
11+
[--dialWithIP6]=[value]
12+
[--dialWithSocks5Password]=[value]
13+
[--dialWithSocks5TCPTimeout]=[value]
14+
[--dialWithSocks5UDPTimeout]=[value]
15+
[--dialWithSocks5Username]=[value]
16+
[--dialWithSocks5]=[value]
1017
[--help|-h]
1118
[--log]=[value]
1219
[--pprof]=[value]
@@ -22,9 +29,23 @@ Brook [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]
2229

2330
# GLOBAL OPTIONS
2431

32+
**--dialWithIP4**="": When the current machine establishes a network connection to the outside IPv4, both TCP and UDP, it is used to specify the IPv4 used
33+
34+
**--dialWithIP6**="": When the current machine establishes a network connection to the outside IPv6, both TCP and UDP, it is used to specify the IPv6 used
35+
36+
**--dialWithSocks5**="": When the current machine establishes a network connection to the outside, both TCP and UDP, with your socks5 proxy, such as 127.0.0.1:1081
37+
38+
**--dialWithSocks5Password**="": If there is
39+
40+
**--dialWithSocks5TCPTimeout**="": time (s) (default: 0)
41+
42+
**--dialWithSocks5UDPTimeout**="": time (s) (default: 60)
43+
44+
**--dialWithSocks5Username**="": If there is
45+
2546
**--help, -h**: show help
2647

27-
**--log**="": Enable log. A valid value is file path for production or 'console' for testing. BTW, if you want to debug SOCKS5 lib, set env SOCKS5_DEBUG=true
48+
**--log**="": Enable log. A valid value is file path or 'console'. If you want to debug SOCKS5 lib, set env SOCKS5_DEBUG=true
2849

2950
**--pprof**="": go http pprof listen addr, such as :6060
3051

@@ -53,12 +74,6 @@ Run as brook server, both TCP and UDP
5374

5475
**--tcpTimeout**="": time (s) (default: 0)
5576

56-
**--toSocks5**="": Forward to socks5 server, requires your socks5 supports standard socks5 TCP and UDP, such as 1.2.3.4:1080
57-
58-
**--toSocks5Password**="": Forward to socks5 server, password
59-
60-
**--toSocks5Username**="": Forward to socks5 server, username
61-
6277
**--udpTimeout**="": time (s) (default: 60)
6378

6479
**--updateListInterval**="": Update list interval, second. default 0, only read one time on start (default: 0)
@@ -67,12 +82,6 @@ Run as brook server, both TCP and UDP
6782

6883
Run as brook client, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook client <-> $ brook server <-> dst]
6984

70-
**--dialWithSocks5**="": Dial with your socks5 proxy, such as 127.0.0.1:1081
71-
72-
**--dialWithSocks5Password**="": Optional
73-
74-
**--dialWithSocks5Username**="": Optional
75-
7685
**--http**="": Where to listen for HTTP proxy connections
7786

7887
**--password, -p**="": Brook server password
@@ -109,12 +118,6 @@ Run as brook wsserver, both TCP and UDP, it will start a standard http server an
109118

110119
**--tcpTimeout**="": time (s) (default: 0)
111120

112-
**--toSocks5**="": Forward to socks5 server, requires your socks5 supports standard socks5 TCP and UDP, such as 1.2.3.4:1080
113-
114-
**--toSocks5Password**="": Forward to socks5 server, password
115-
116-
**--toSocks5Username**="": Forward to socks5 server, username
117-
118121
**--udpTimeout**="": time (s) (default: 60)
119122

120123
**--updateListInterval**="": Update list interval, second. default 0, only read one time on start (default: 0)
@@ -127,12 +130,6 @@ Run as brook wsclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks
127130

128131
**--address**="": Specify address instead of resolving addresses from host, such as 1.2.3.4:443
129132

130-
**--dialWithSocks5**="": Dial with your socks5 proxy, such as 127.0.0.1:1081
131-
132-
**--dialWithSocks5Password**="": Optional
133-
134-
**--dialWithSocks5Username**="": Optional
135-
136133
**--http**="": Where to listen for HTTP proxy connections
137134

138135
**--password, -p**="": Brook wsserver password
@@ -173,12 +170,6 @@ Run as brook wssserver, both TCP and UDP, it will start a standard https server
173170

174171
**--tcpTimeout**="": time (s) (default: 0)
175172

176-
**--toSocks5**="": Forward to socks5 server, requires your socks5 supports standard socks5 TCP and UDP, such as 1.2.3.4:1080
177-
178-
**--toSocks5Password**="": Forward to socks5 server, password
179-
180-
**--toSocks5Username**="": Forward to socks5 server, username
181-
182173
**--udpTimeout**="": time (s) (default: 60)
183174

184175
**--updateListInterval**="": Update list interval, second. default 0, only read one time on start (default: 0)
@@ -193,12 +184,6 @@ Run as brook wssclient, both TCP and UDP, to start a socks5 proxy, [src <-> sock
193184

194185
**--ca**="": When server is brook wssserver, specify ca instead of insecure, such as /path/to/ca.pem
195186

196-
**--dialWithSocks5**="": Dial with your socks5 proxy, such as 127.0.0.1:1081
197-
198-
**--dialWithSocks5Password**="": Optional
199-
200-
**--dialWithSocks5Username**="": Optional
201-
202187
**--http**="": Where to listen for HTTP proxy connections
203188

204189
**--insecure**: Client do not verify the server's certificate chain and host name
@@ -247,14 +232,16 @@ Run as brook quicserver, both TCP and UDP
247232

248233
## quicclient
249234

250-
Run as brook quicclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook quicclient <-> $ brook quicserver <-> dst]
235+
Run as brook quicclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook quicclient <-> $ brook quicserver <-> dst]. (Note that the global dial parameter is ignored now)
251236

252237
**--address**="": Specify address instead of resolving addresses from host, such as 1.2.3.4:443
253238

254-
**--ca**="": When server is brook wssserver, specify ca instead of insecure, such as /path/to/ca.pem
239+
**--ca**="": Specify ca instead of insecure, such as /path/to/ca.pem
255240

256241
**--http**="": Where to listen for HTTP proxy connections
257242

243+
**--insecure**: Client do not verify the server's certificate chain and host name
244+
258245
**--password, -p**="": Brook quicserver password
259246

260247
**--quicserver, -s**="": Brook quicserver address, like: quic://google.com:443. Do not omit the port under any circumstances
@@ -283,7 +270,7 @@ Run as relay over brook, both TCP and UDP, this means access [from address] is e
283270

284271
**--password, -p**="": Password
285272

286-
**--server, -s**="": brook server or brook wsserver or brook wssserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain:443/ws, quic://domain.com:443
273+
**--server, -s**="": brook server or brook wsserver or brook wssserver or brook quicserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain:443/ws, quic://domain.com:443
287274

288275
**--tcpTimeout**="": time (s) (default: 0)
289276

@@ -321,7 +308,7 @@ Run as dns server over brook, both TCP and UDP, [src <-> $ brook dnserversoverbr
321308

322309
**--password, -p**="": Password
323310

324-
**--server, -s**="": brook server or brook wsserver or brook wssserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain.com:443/ws, quic://domain.com:443
311+
**--server, -s**="": brook server or brook wsserver or brook wssserver or brook quicserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain.com:443/ws, quic://domain.com:443
325312

326313
**--tcpTimeout**="": time (s) (default: 0)
327314

@@ -333,7 +320,7 @@ Run as dns server over brook, both TCP and UDP, [src <-> $ brook dnserversoverbr
333320

334321
## tproxy
335322

336-
Run as transparent proxy, both TCP and UDP, only works on Linux, [src <-> $ brook tproxy <-> $ brook server/wsserver/wssserver/quicserver <-> dst]
323+
Run as transparent proxy, a router gateway, both TCP and UDP, only works on Linux, [src <-> $ brook tproxy <-> $ brook server/wsserver/wssserver/quicserver <-> dst]
337324

338325
**--address**="": When server is brook wsserver or brook wssserver or brook quicserver, specify address instead of resolving addresses from host, such as 1.2.3.4:443
339326

@@ -349,12 +336,6 @@ Run as transparent proxy, both TCP and UDP, only works on Linux, [src <-> $ broo
349336

350337
**--ca**="": When server is brook wssserver or brook quicserver, specify ca instead of insecure, such as /path/to/ca.pem
351338

352-
**--dialWithSocks5**="": Dial with your socks5 proxy, such as 127.0.0.1:1081
353-
354-
**--dialWithSocks5Password**="": Optional
355-
356-
**--dialWithSocks5Username**="": Optional
357-
358339
**--disableA**: Disable A query
359340

360341
**--disableAAAA**: Disable AAAA query
@@ -363,7 +344,7 @@ Run as transparent proxy, both TCP and UDP, only works on Linux, [src <-> $ broo
363344

364345
**--dnsForDefault**="": DNS server for resolving domains NOT in list (default: 8.8.8.8:53)
365346

366-
**--dnsListen**="": Start a DNS server, like: ':53'
347+
**--dnsListen**="": Start a DNS server, like: ':53'. MUST contain IP, like '192.168.1.1:53', if you expect your gateway to accept requests from clients to other public DNS servers at the same time
367348

368349
**--doNotRunScripts**: This will not change iptables and others if you want to do by yourself
369350

@@ -375,7 +356,9 @@ Run as transparent proxy, both TCP and UDP, only works on Linux, [src <-> $ broo
375356

376357
**--password, -p**="": Password
377358

378-
**--server, -s**="": brook server or brook wsserver or brook wssserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain.com:443/ws, quic://domain.com:443
359+
**--redirectDNS**="": It is usually the value of dnsListen. If the client has set custom DNS instead of dnsListen, this parameter can be intercepted and forwarded to dnsListen. Usually you don't need to set this, only if you want to control it instead of being proxied directly as normal UDP data.
360+
361+
**--server, -s**="": brook server or brook wsserver or brook wssserver or brook quicserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain.com:443/ws, quic://domain.com:443
379362

380363
**--tcpTimeout**="": time (s) (default: 0)
381364

@@ -413,12 +396,6 @@ Generate brook link
413396

414397
Run as client and connect to brook link, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook connect <-> $ brook server/wsserver/wssserver/quicserver <-> dst]
415398

416-
**--dialWithSocks5**="": If you already have a socks5, such as 127.0.0.1:1081, and want [src <-> listen socks5 <-> $ brook connect <-> dialWithSocks5 <-> $ brook server/wsserver/wssserver <-> dst]
417-
418-
**--dialWithSocks5Password**="": Optional
419-
420-
**--dialWithSocks5Username**="": Optional
421-
422399
**--http**="": Where to listen for HTTP proxy connections
423400

424401
**--link, -l**="": brook link, you can get it via $ brook link
@@ -461,6 +438,24 @@ Run as standalone dns server, both TCP and UDP
461438

462439
**--udpTimeout**="": time (s) (default: 60)
463440

441+
## dhcpserver
442+
443+
Run as standalone dhcp server. Note that you need to stop other dhcp servers, if there are.
444+
445+
**--cache**="": Cache file, local absolute file path, default is $HOME/.brook.dhcpserver
446+
447+
**--count**="": IP range from the start, which you want to assign to clients (default: 100)
448+
449+
**--dnsserver**="": The dns server which you want to assign to clients, such as: 192.168.1.1 or 8.8.8.8
450+
451+
**--gateway**="": The router gateway which you want to assign to clients, such as: 192.168.1.1
452+
453+
**--netmask**="": Subnet netmask which you want to assign to clients (default: 255.255.255.0)
454+
455+
**--serverip**="": DHCP server IP, the IP of the this machine, you shoud set a static IP to this machine before doing this, such as: 192.168.1.10
456+
457+
**--start**="": Start IP which you want to assign to clients, such as: 192.168.1.100
458+
464459
## socks5
465460

466461
Run as standalone standard socks5 server, both TCP and UDP
@@ -523,7 +518,7 @@ Test UDP and TCP of socks5 server
523518

524519
## testbrook
525520

526-
Test UDP and TCP of brook server/wsserver/wssserver
521+
Test UDP and TCP of brook server/wsserver/wssserver/quicserver. (Note that the global dial parameter is ignored now)
527522

528523
**--dns**="": DNS server for connecting (default: 8.8.8.8:53)
529524

docs/example-zh.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,6 @@ brook relayoverbrook ... --from 127.0.0.1:5353 --to 8.8.8.8:53
234234
brook dnsserveroverbrook ... --listen 127.0.0.1:53
235235
```
236236

237-
规则
238-
239-
- --dns
240-
- --dnsForBypass
241-
- --bypassDomainList
242-
- --blockDomainList
243-
244237
### brook tproxy 透明代理网关在官网原版 OpenWrt
245238

246239
**无需操作 iptables!**

docs/example.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,6 @@ brook relayoverbrook ... --from 127.0.0.1:5353 --to 8.8.8.8:53
234234
brook dnsserveroverbrook ... --listen 127.0.0.1:53
235235
```
236236

237-
Rule
238-
239-
- --dns
240-
- --dnsForBypass
241-
- --bypassDomainList
242-
- --blockDomainList
243-
244237
### brook tproxy Transparent Proxy Gateway on official OpenWrt
245238

246239
**No need to manipulate iptables!**

ping/ping.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"version": "20230122",
3-
"text": "", "link": ""
2+
"version": "20230401",
3+
"text": "",
4+
"link": ""
45
}

0 commit comments

Comments
 (0)