Skip to main content
  1. Archive/

Cloudflare Tunnel + Brook: A High-Value Acceleration Solution for Slow VPS

·2 mins· · · #Idea #Networking
Table of Contents
Network & Security - This article is part of a series.
Part : This Article

Note: Technical audit performed in 2026. While protocols evolve, the underlying logic of Cloudflare’s edge acceleration remains robust.

The Principle
#

Use Cloudflare Tunnel to map local services to Cloudflare’s edge network. VPS with poor connectivity (like Oracle Free Tier) can gain a significant speed boost through CDN edge acceleration.

graph LR
    User((Client)) -- "WSS Request" --> CF[Cloudflare Edge]
    subgraph "Your Home/VPS"
        CFT[cloudflared] -- "Persistent Tunnel" --> CF
        Brook[Brook WSServer] -- "Local Loopback" --> CFT
    end
    style User fill:#f9f,stroke:#333,stroke-width:2px
    style CF fill:#f96,stroke:#333,stroke-width:2px
    style Brook fill:#4ecdc4,stroke:#333,stroke-width:2px

Setup Guide
#

  1. Preparation:

  2. Start the Server: brook wsserver --listen 127.0.0.1:8888 --password your_pass

  3. Configure the Tunnel: In the Cloudflare dashboard, point your domain (Public Hostname) to http://localhost:8888.

  4. Crucial Setting (Must Do): Ensure WebSocket support is enabled in Cloudflare’s “Network” settings; otherwise, the WSS connection will be terminated immediately.

  5. Client Connection: Select WSS mode on your client. Traffic now flows through the encrypted tunnel.

Pros and Cons
#

Pros:

  • Stealth: Your VPS IP is never exposed. Cloudflare handles all traffic, significantly reducing the risk of IP blocking.
  • Penetration: Works in IPv6-only or NAT/internal network environments.
  • Free: Cloudflare’s free tier for personal users is more than sufficient.

Cons:

  • Latency: The extra hops add latency (typically in the hundreds of milliseconds), making it unsuitable for gaming.
  • UDP: Support for non-HTTP UDP traffic is limited; recommended for TCP/WSS scenarios.

Further Reading
#


Created: 2022-03-16 Updated: 2026-01-04

Network & Security - This article is part of a series.
Part : This Article