Skip to content

Commit

Permalink
prepare 20210701
Browse files Browse the repository at this point in the history
  • Loading branch information
txthinking committed Jun 18, 2021
1 parent 55c28b6 commit 011c034
Show file tree
Hide file tree
Showing 18 changed files with 237 additions and 274 deletions.
76 changes: 35 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
[中文](README_ZH.md)

[![Build Status](https://travis-ci.org/txthinking/brook.svg?branch=master)](https://travis-ci.org/txthinking/brook)
[![Docs](https://img.shields.io/badge/Tutorial-docs-yellow.svg)](https://txthinking.github.io/brook/)
[![Blog](https://img.shields.io/badge/Tutorial-Slides-blueviolet.svg)](https://talks.txthinking.com)
[![Youtube](https://img.shields.io/badge/Tutorial-Youtube-red.svg)](https://www.youtube.com/txthinking)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![Donate](https://img.shields.io/badge/Support-Donate-ff69b4.svg)](https://www.txthinking.com/opensource-support.html)

<p align="center">
<img style="float:right;" src="https://txthinking.github.io/brook/_static/brook.png" alt="Brook"/>
</p>

---

**v20210616 Pre-release**
**v20210701**

- [CLI] $ brook relayoverbrook
- [GUI] macOS, optimize tun mode
- [GUI] Windows, optimize compatibility, such as virtual machines
- [GUI] If the server information is added through brook link, the details will not be displayed

[Document](https://txthinking.github.io/brook/) [Video](https://www.youtube.com/txthinking) [Blog](https://talks.txthinking.com) [Discussions(ask here)](https://github.com/txthinking/brook/discussions)
| 🌚 | 🌝 |
| --- | --- |
| MUST READ | https://txthinking.github.io/brook/#/README |
| Install CLI | https://txthinking.github.io/brook/#/install-cli |
| Install GUI | https://txthinking.github.io/brook/#/install-gui |
| OpenWrt GUI | https://txthinking.github.io/brook/#/brook-tproxy-gui |
| Document | https://txthinking.github.io/brook/ |
| Blog | https://talks.txthinking.com |
| Youtube | https://www.youtube.com/txthinking |
| Discussions | https://github.com/txthinking/brook/discussions |

---

Expand Down Expand Up @@ -55,41 +56,34 @@ USAGE:
brook [global options] command [command options] [arguments...]
VERSION:
20210616
20210701
AUTHOR:
Cloud <cloud@txthinking.com>
COMMANDS:
server Run as brook server, both TCP and UDP
servers Run as multiple brook servers
client Run as brook client, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook client <-> $ brook server <-> dst], [works with
$ brook server]
map Run as mapping, both TCP and UDP, this means access [from address] is equal to [to address], [src <-> from address <-> $ brook <-> to addres
s], works with $ brook server/wsserver/wssserver
dns Run as DNS server, both TCP and UDP, [src <-> $ brook dns <-> $ brook <-> dns server] or [src <-> $ brook dns <-> dns server for bypass], wo
rks with $ brook server/wsserver/wssserver
tproxy Run as transparent proxy, both TCP and UDP, only works on Linux, [src <-> $ brook tproxy <-> $ brook <-> dst], works with $ brook server/wss
erver/wssserver
wsserver Run as brook wsserver, both TCP and UDP, it will start a standard http server and websocket server
wssserver Run as brook wssserver, both TCP and UDP, it will start a standard https server and websocket server
wsclient Run as brook wsclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wsclient <-> $ brook wsserver <-> dst], [works
with $ brook wsserver]
wssclient Run as brook wssclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wssclient <-> $ brook wssserver <-> dst], [wo
rks with $ brook wssserver]
link Print brook link
qr Print brook server QR code
connect Connect via standard sharing link (brook server & brook wsserver & brook wssserver)
relay Run as standalone relay, both TCP and UDP, this means access [listen address] is equal to access [to address], [src <-> listen address <-> t
o address]
relays Run as multiple standalone relays
socks5 Run as standalone standard socks5 server, both TCP and UDP
socks5tohttp Convert socks5 to http proxy, [src <-> listen address(http proxy) <-> socks5 address <-> dst]
hijackhttps Hijack domains and assume is TCP/TLS/443. Requesting these domains from anywhere in the system will be hijacked . [src <-> $ brook hijackhtt
ps <-> socks5 server] or [src <-> direct]
pac Run as PAC server or save PAC to file
howto Print some useful tutorial resources
help, h Shows a list of commands or help for one command
server Run as brook server, both TCP and UDP
client Run as brook client, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook client <-> $ brook server <-> dst]
wsserver Run as brook wsserver, both TCP and UDP, it will start a standard http server and websocket server
wsclient Run as brook wsclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wsclient <-> $ brook wsserver <-> dst]
wssserver Run as brook wssserver, both TCP and UDP, it will start a standard https server and websocket server
wssclient Run as brook wssclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wssclient <-> $ brook wssserver <-> dst]
relayoverbrook Run as relay over brook, both TCP and UDP, this means access [from address] is equal to [to address], [src <-> from address <-> $ brook server/wsserver/wssserver <-> to address]
dns Run as dns server over brook, both TCP and UDP, [src <-> $ brook dns <-> $ brook server/wsserver/wssserver <-> dns] or [src <-> $ brook dns <-> dnsForBypass]
tproxy Run as transparent proxy, both TCP and UDP, only works on Linux, [src <-> $ brook tproxy <-> $ brook server/wsserver/wssserver <-> dst]
link Print brook link
qr Print brook server QR code
connect Connect via standard sharing link (brook server & brook wsserver & brook wssserver)
relay Run as standalone relay, both TCP and UDP, this means access [from address] is equal to access [to address], [src <-> from address <-> to address]
socks5 Run as standalone standard socks5 server, both TCP and UDP
socks5tohttp Convert socks5 to http proxy, [src <-> listen address(http proxy) <-> socks5 address <-> dst]
hijackhttps Hijack domains and assume is TCP/TLS/443. Requesting these domains from anywhere in the system will be hijacked . [src <-> $ brook hijackhttps <-> socks5 server] or [src <-> direct]
pac Run as PAC server or save PAC to file
servers Run as multiple brook servers
relays Run as multiple standalone relays
map Run as mapping, both TCP and UDP, this means access [from address] is equal to [to address], [src <-> from address <-> brook <-> to address]
howto Print some useful tutorial resources
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--debug, -d Enable debug (default: false)
Expand Down
76 changes: 35 additions & 41 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
[English](README.md)

[![Build Status](https://travis-ci.org/txthinking/brook.svg?branch=master)](https://travis-ci.org/txthinking/brook)
[![文档](https://img.shields.io/badge/%E6%95%99%E7%A8%8B-%E6%96%87%E6%A1%A3-yellow.svg)](https://txthinking.github.io/brook/#/zh-cn/)
[![博客](https://img.shields.io/badge/%E6%95%99%E7%A8%8B-%E5%B9%BB%E7%81%AF%E7%89%87-blueviolet.svg)](https://talks.txthinking.com)
[![视频](https://img.shields.io/badge/%E6%95%99%E7%A8%8B-%E8%A7%86%E9%A2%91-red.svg)](https://www.youtube.com/txthinking)
[![开源协议: GPL v3](https://img.shields.io/badge/%E5%BC%80%E6%BA%90%E5%8D%8F%E8%AE%AE-GPL%20v3-yellow.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![捐赠](https://img.shields.io/badge/%E6%94%AF%E6%8C%81-%E6%8D%90%E8%B5%A0-ff69b4.svg)](https://www.txthinking.com/opensource-support.html)

<p align="center">
<img style="float:right;" src="https://txthinking.github.io/brook/_static/brook.png" alt="Brook"/>
</p>

---

**v20210616 Pre-release**
**v20210701**

- [CLI] $ brook relayoverbrook
- [GUI] macOS, 优化 tun 模式
- [GUI] Windows, 优化兼容性, 比如虚拟机
- [GUI] 如果服务器信息通过brook link添加, 不会显示详情

[Document](https://txthinking.github.io/brook/) [Video](https://www.youtube.com/txthinking) [Blog](https://talks.txthinking.com) [Discussions(ask here)](https://github.com/txthinking/brook/discussions)
| 🌚 | 🌝 |
| --- | --- |
| 必读 | https://txthinking.github.io/brook/#/README |
| 安装 CLI | https://txthinking.github.io/brook/#/install-cli |
| 安装 GUI | https://txthinking.github.io/brook/#/install-gui |
| OpenWrt GUI | https://txthinking.github.io/brook/#/brook-tproxy-gui |
| 文档 | https://txthinking.github.io/brook/ |
| Blog | https://talks.txthinking.com |
| Youtube | https://www.youtube.com/txthinking |
| Discussions | https://github.com/txthinking/brook/discussions |

---

Expand Down Expand Up @@ -54,41 +55,34 @@ USAGE:
brook [global options] command [command options] [arguments...]
VERSION:
20210616
20210701
AUTHOR:
Cloud <cloud@txthinking.com>
COMMANDS:
server Run as brook server, both TCP and UDP
servers Run as multiple brook servers
client Run as brook client, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook client <-> $ brook server <-> dst], [works with
$ brook server]
map Run as mapping, both TCP and UDP, this means access [from address] is equal to [to address], [src <-> from address <-> $ brook <-> to addres
s], works with $ brook server/wsserver/wssserver
dns Run as DNS server, both TCP and UDP, [src <-> $ brook dns <-> $ brook <-> dns server] or [src <-> $ brook dns <-> dns server for bypass], wo
rks with $ brook server/wsserver/wssserver
tproxy Run as transparent proxy, both TCP and UDP, only works on Linux, [src <-> $ brook tproxy <-> $ brook <-> dst], works with $ brook server/wss
erver/wssserver
wsserver Run as brook wsserver, both TCP and UDP, it will start a standard http server and websocket server
wssserver Run as brook wssserver, both TCP and UDP, it will start a standard https server and websocket server
wsclient Run as brook wsclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wsclient <-> $ brook wsserver <-> dst], [works
with $ brook wsserver]
wssclient Run as brook wssclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wssclient <-> $ brook wssserver <-> dst], [wo
rks with $ brook wssserver]
link Print brook link
qr Print brook server QR code
connect Connect via standard sharing link (brook server & brook wsserver & brook wssserver)
relay Run as standalone relay, both TCP and UDP, this means access [listen address] is equal to access [to address], [src <-> listen address <-> t
o address]
relays Run as multiple standalone relays
socks5 Run as standalone standard socks5 server, both TCP and UDP
socks5tohttp Convert socks5 to http proxy, [src <-> listen address(http proxy) <-> socks5 address <-> dst]
hijackhttps Hijack domains and assume is TCP/TLS/443. Requesting these domains from anywhere in the system will be hijacked . [src <-> $ brook hijackhtt
ps <-> socks5 server] or [src <-> direct]
pac Run as PAC server or save PAC to file
howto Print some useful tutorial resources
help, h Shows a list of commands or help for one command
server Run as brook server, both TCP and UDP
client Run as brook client, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook client <-> $ brook server <-> dst]
wsserver Run as brook wsserver, both TCP and UDP, it will start a standard http server and websocket server
wsclient Run as brook wsclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wsclient <-> $ brook wsserver <-> dst]
wssserver Run as brook wssserver, both TCP and UDP, it will start a standard https server and websocket server
wssclient Run as brook wssclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wssclient <-> $ brook wssserver <-> dst]
relayoverbrook Run as relay over brook, both TCP and UDP, this means access [from address] is equal to [to address], [src <-> from address <-> $ brook server/wsserver/wssserver <-> to address]
dns Run as dns server over brook, both TCP and UDP, [src <-> $ brook dns <-> $ brook server/wsserver/wssserver <-> dns] or [src <-> $ brook dns <-> dnsForBypass]
tproxy Run as transparent proxy, both TCP and UDP, only works on Linux, [src <-> $ brook tproxy <-> $ brook server/wsserver/wssserver <-> dst]
link Print brook link
qr Print brook server QR code
connect Connect via standard sharing link (brook server & brook wsserver & brook wssserver)
relay Run as standalone relay, both TCP and UDP, this means access [from address] is equal to access [to address], [src <-> from address <-> to address]
socks5 Run as standalone standard socks5 server, both TCP and UDP
socks5tohttp Convert socks5 to http proxy, [src <-> listen address(http proxy) <-> socks5 address <-> dst]
hijackhttps Hijack domains and assume is TCP/TLS/443. Requesting these domains from anywhere in the system will be hijacked . [src <-> $ brook hijackhttps <-> socks5 server] or [src <-> direct]
pac Run as PAC server or save PAC to file
servers Run as multiple brook servers
relays Run as multiple standalone relays
map Run as mapping, both TCP and UDP, this means access [from address] is equal to [to address], [src <-> from address <-> brook <-> to address]
howto Print some useful tutorial resources
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--debug, -d Enable debug (default: false)
Expand Down
89 changes: 14 additions & 75 deletions cli/brook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var debugAddress string
func main() {
app := cli.NewApp()
app.Name = "Brook"
app.Version = "20210616"
app.Version = "20210701"
app.Usage = "A cross-platform strong encryption and not detectable proxy"
app.Authors = []*cli.Author{
{
Expand Down Expand Up @@ -206,10 +206,6 @@ func main() {
Aliases: []string{"p"},
Usage: "Server password",
},
&cli.StringFlag{
Name: "domain",
Usage: "deprecated, please use $ brook wssserver",
},
&cli.StringFlag{
Name: "path",
Usage: "URL path",
Expand All @@ -227,17 +223,14 @@ func main() {
},
},
Action: func(c *cli.Context) error {
if c.String("domain") != "" {
log.Println("--domain deprecated, please use $ brook wssserver")
}
if (c.String("listen") == "" && c.String("domain") == "") || c.String("password") == "" {
if c.String("listen") == "" || c.String("password") == "" {
cli.ShowCommandHelp(c, "wsserver")
return nil
}
if debug {
enableDebug()
}
s, err := brook.NewWSServer(c.String("listen"), c.String("password"), c.String("domain"), c.String("path"), c.Int("tcpTimeout"), c.Int("udpTimeout"))
s, err := brook.NewWSServer(c.String("listen"), c.String("password"), "", c.String("path"), c.Int("tcpTimeout"), c.Int("udpTimeout"))
if err != nil {
return err
}
Expand Down Expand Up @@ -712,7 +705,7 @@ func main() {
}()
return s.ListenAndServe()
}
if c.String("listen") == "" || c.String("s") == "" || c.String("password") == "" {
if c.String("listen") == "" || c.String("server") == "" || c.String("password") == "" {
cli.ShowCommandHelp(c, "tproxy")
return nil
}
Expand Down Expand Up @@ -1229,36 +1222,9 @@ func main() {
},
},
Action: func(c *cli.Context) error {
if len(c.StringSlice("listenpassword")) == 0 {
cli.ShowCommandHelp(c, "servers")
return nil
}
if debug {
enableDebug()
}
l := make([]*brook.Server, 0)
for _, v := range c.StringSlice("listenpassword") {
ss := strings.Split(v, " ")
if len(ss) != 2 {
return errors.New("invalid listenpassword")
}
s, err := brook.NewServer(ss[0], ss[1], c.Int("tcpTimeout"), c.Int("udpTimeout"))
if err != nil {
return err
}
l = append(l, s)
}
for _, v := range l {
go func(v *brook.Server) {
log.Println(v.ListenAndServe())
}(v)
}
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
<-sigs
for _, v := range l {
v.Shutdown()
}
fmt.Println("$ brook servers has been removed, you may like joker:")
fmt.Println("$ joker brook server ...")
fmt.Println("$ joker brook server ...")
return nil
},
},
Expand All @@ -1282,36 +1248,9 @@ func main() {
},
},
Action: func(c *cli.Context) error {
if len(c.StringSlice("fromto")) == 0 {
cli.ShowCommandHelp(c, "relays")
return nil
}
if debug {
enableDebug()
}
l := make([]*brook.Relay, 0)
for _, v := range c.StringSlice("fromto") {
ss := strings.Split(v, " ")
if len(ss) != 2 {
return errors.New("invalid fromto")
}
s, err := brook.NewRelay(ss[0], ss[1], c.Int("tcpTimeout"), c.Int("udpTimeout"))
if err != nil {
return err
}
l = append(l, s)
}
for _, v := range l {
go func(v *brook.Relay) {
log.Println(v.ListenAndServe())
}(v)
}
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
<-sigs
for _, v := range l {
v.Shutdown()
}
fmt.Println("$ brook relays has been removed, you may like joker:")
fmt.Println("$ joker brook relay ...")
fmt.Println("$ joker brook relay ...")
return nil
},
},
Expand Down Expand Up @@ -1360,12 +1299,12 @@ func main() {
Usage: "Print some useful tutorial resources",
Action: func(c *cli.Context) error {
fmt.Println("")
fmt.Println("Brook Github:", "https://github.com/txthinking/brook")
fmt.Println("Brook Docs:", "https://txthinking.github.io/brook")
fmt.Println("Brook Community:", "https://github.com/txthinking/brook/discussions")
fmt.Println("Github:", "https://github.com/txthinking/brook")
fmt.Println("Docs:", "https://txthinking.github.io/brook")
fmt.Println("Discussions:", "https://github.com/txthinking/brook/discussions")
fmt.Println("")
fmt.Println("Blog:", "https://talks.txthinking.com")
fmt.Println("Youtube:", "https://www.youtube.com/channel/UC5j8-I5Y4lWo4KTa4_0Kx5A")
fmt.Println("Youtube:", "https://www.youtube.com/txthinking")
fmt.Println("")
return nil
},
Expand Down
2 changes: 0 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
| Brook.dmg | GUI | macOS 64 bit |
| Brook.exe | GUI | Windows 64 bit |
| Brook.apk | GUI | Android |
| BrookLite.dmg | GUI | macOS 64 bit |
| BrookLite.exe | GUI | Windows 64 bit |
| brook_linux_amd64.ipk | GUI | OpenWrt Linux 64 bit |
| brook_linux_386.ipk | GUI | OpenWrt Linux 32 bit |
| brook_linux_arm64.ipk | GUI | OpenWrt Linux arm64 |
Expand Down
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![logo](https://storage.googleapis.com/txthinking/_/brook.png)
![logo](https://txthinking.github.io/brook/_static/brook.png)

# Brook

Expand Down
4 changes: 2 additions & 2 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
- [[CLI] \$ brook wssclient](brook-wssclient.md)
- [[GUI] Client](brook-wssclient-gui.md)

- brook map
- brook relayoverbrook

- [[CLI] \$ brook map](brook-map.md)
- [[CLI] \$ brook relayoverbrook](brook-relayoverbrook.md)

- brook dns

Expand Down
Loading

0 comments on commit 011c034

Please sign in to comment.