Go Apache-2.0

brook

Brook is a cross-platform network tunneling tool that helps securely transmit data between different networks. (Brook 是一个用于建立网络隧道的跨平台工具,帮助在不同网络之间安全地传输数据。)

G

g-brook

Dernière activité 26 août 2026
g-brook/brook

370

étoiles

26

forks

0

issues ouvertes

cross-platformgolangnat-traversalnetwork-tunnelport-forwarding-udpproxytcp-proxy-servertunneltunnel-cltunnel-serverudp-proxywebsocket

Ce README est souvent en anglais.

Brook Logo

Brook

Self-hosted TCP / UDP / HTTP(S) / WebSocket tunnels with a Web management panel

Latest Release Stars Forks License Go Version Issues

中文文档 | English (Docs) | Official Website | Quick Start | FAQ


g-brook/brook is a self-hosted network tunnel written in Go. It connects services behind NAT to a server you control and supports TCP, UDP, HTTP(S), and WebSocket tunnels through a Web management interface.

What can I use it for?

Use case How Brook helps
Preview a local Web app Publish a temporary HTTP(S) route without opening an inbound port on the client network.
Reach a TCP or UDP service Forward SSH, databases, game servers, or custom protocols through a Brook server.
Operate several tunnels Create tokens and routes in the Web panel and inspect connection status in one place.
Run on mixed environments Use pre-built server and client packages for Linux, macOS, and Windows.

Note

When sharing or searching for this project, use the full repository name g-brook/brook. The name “Brook” is also used by other network projects.

✨ Key Highlights

  • 🚀 Blazing Fast Performance: High-concurrency architecture based on Go routines, with low latency and low resource consumption.
  • 🛡️ All-around Compatibility: Supports SSH, HTTP/HTTPS, MySQL, Redis, RDP, and almost all mainstream application protocols.
  • 🎨 Visual Management: Built-in modern Web panel for one-click initialization, real-time traffic monitoring, and connection status.
  • 🔗 Versatile Protocols: Native support for TCP / UDP / HTTP(S) / WebSocket tunnels, easily handling various network environments (including CDN and firewall restrictions).
  • 🛠️ Minimal Configuration: Only one JSON file needed, with auto-reconnection for worry-free operation.
  • 💻 Cross-platform Support: Pre-compiled packages for Linux, macOS (Intel/M-series), and Windows (x64/ARM64).

📸 Interface Preview

Click to expand and view management interface screenshots
Initialization Wizard Secure Login
Token Management Tunnel Configuration

⚡ Quick Start

Important

Brook exposes services across network boundaries. In the reviewed v0.3.2 code path, the manager and smux data connections are not wrapped in TLS. Use an encrypted overlay plus application-layer TLS/SSH, restrict access with firewall rules, and place the Web panel behind TLS or a trusted network before using it beyond local testing. Review install.sh before running the one-line installer; manual downloads and SHA-256 digests are available on the Releases page.

bash -c "$(curl -fsSL https://www.gbrook.cc/install.sh)"

2. Manual Server Deployment

  1. Download and Extract: Download the brook-sev for your platform from GitHub Releases.
  2. Prepare Configuration (server.json):
    {
      "enableWeb": true,
      "webPort": 8000,
      "serverPort": 8909,
      "tunnelPort": 8919,
      "logger": { "logLevel": "info", "logPath": "./", "outs": "file" }
    }
  3. Start Service:
    ./brook-sev -c ./server.json
  4. Access Panel: Open your browser and visit http://your-ip:8000/index for initialization.

3. Client Configuration

  1. Get Token: Generate it in the Web management backend.
  2. Prepare Configuration (client.json):
    {
      "serverHost": "your-server-ip",
      "serverPort": 8909,
      "token": "YOUR_GENERATED_TOKEN",
      "tunnels": [
        { "type": "tcp", "destination": "127.0.0.1:80", "proxyId": "web-proxy-1" }
      ]
    }
  3. Start Client:
    ./brook-cli -c ./client.json

4. Linux Background Mode (systemd)

On Linux distributions with systemd, Brook provides built-in service management commands. The first time you run start, it will automatically create the unit file under /etc/systemd/system/ and then start the service.

Server:

sudo ./brook-sev start -c ./server.json
sudo ./brook-sev restart
sudo ./brook-sev stop
sudo ./brook-sev status
./brook-sev version

Client:

sudo ./brook-cli start -c ./client.json
sudo ./brook-cli restart
sudo ./brook-cli stop
sudo ./brook-cli status
./brook-cli version

5. Windows Startup

  • Foreground (run in console): open cmd in the extracted directory and run brook-sev.exe -c server.json / brook-cli.exe -c client.json
  • Console helper: use run.bat to launch and keep the console window open
  • Background mode: brook-sev.exe start / brook-cli.exe start (then use restart / stop / status / version)

📥 Resource Download

Server (brook-sev)

Platform Arch File Direct Download
Linux amd64 brook-sev_Linux-x86_64.amd64.tar.gz ⬇️ Download
Linux arm64 brook-sev_Linux-arm64.tar.gz ⬇️ Download
macOS ARM64 (Apple M) brook-sev_macOS-ARM64.Apple-M.tar.gz ⬇️ Download
macOS Intel brook-sev_macOS-Intel.tar.gz ⬇️ Download
Windows x86_64 brook-sev_Windows-x86_64.tar.gz ⬇️ Download
Windows ARM64 brook-sev_Windows-ARM64.tar.gz ⬇️ Download

Client (brook-cli)

Platform Arch File Direct Download
Linux amd64 brook-cli_Linux-x86_64.amd64.tar.gz ⬇️ Download
Linux arm64 brook-cli_Linux-arm64.tar.gz ⬇️ Download
macOS ARM64 (Apple M) brook-cli_macOS-ARM64.Apple-M.tar.gz ⬇️ Download
macOS Intel brook-cli_macOS-Intel.tar.gz ⬇️ Download
Windows x86_64 brook-cli_Windows-x86_64.tar.gz ⬇️ Download
Windows arm64 brook-cli_Windows-arm64.tar.gz ⬇️ Download

🛠️ Advanced Development

Build from Source

# Frontend Build
cd portal/server/ && npm install && npm run build

# Server/Client Build
cd scmd/ && bash build.sh
cd ccmd/ && bash build.sh

❓ FAQ

How to solve connection timeouts? Please ensure that ports 8909 and 8919 on the server side are open in the firewall/security group.
Does it support CDN forwarding? Yes, by using WebSocket protocol tunnels, you can implement CDN forwarding with Nginx or Cloudflare.
How to run in the background? Linux users can use `systemd` scripts or directly run `sudo ./brook-cli start`.

📄 Open Source License

This project is open-sourced under the Apache License 2.0 agreement.


If Brook helps you, please give it a ⭐ Star!
Made with Go

Projets similaires

A cross-platform programmable network tool

Goandroidcross-platformdecryption
Ttxthinking
15,2 k étoiles2,4 k

🔥 Proxy is a high performance HTTP(S) proxies, SOCKS5 proxies,WEBSOCKET, TCP, UDP proxy server implemented by golang. Now, it supports chain-style proxies,nat forwarding in different lan,TCP/UDP port forwarding, SSH forwarding.Proxy是golang实现的高性能http,https,websocket,tcp,socks5代理服务器,支持内网穿透,链式代理,通讯加密,智能HTTP,SOCKS5代理,黑白名单,限速,限流量,限连接数,跨平台,KCP支持,认证API。

Godns-proxyencryption-proxyhttp
Ssnail007
17,1 k étoiles3,1 k

GO Simple Tunnel - a simple tunnel written in golang

Godnsgogolang
Gginuerzh
18,2 k étoiles2,6 k