惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Exploit Database - CXSecurity.com
S
Secure Thoughts
A
Arctic Wolf
V
Vulnerabilities – Threatpost
S
Schneier on Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
NISL@THU
NISL@THU
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Palo Alto Networks Blog
L
Lohrmann on Cybersecurity
Schneier on Security
Schneier on Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Scott Helme
Scott Helme
L
LINUX DO - 最新话题
L
LangChain Blog
量子位
T
Threatpost
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
W
WeLiveSecurity
Last Week in AI
Last Week in AI
美团技术团队
The GitHub Blog
The GitHub Blog
The Last Watchdog
The Last Watchdog
C
CERT Recently Published Vulnerability Notes
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LINUX DO - 热门话题
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Troy Hunt's Blog
Webroot Blog
Webroot Blog
云风的 BLOG
云风的 BLOG
博客园 - 叶小钗
V2EX - 技术
V2EX - 技术
雷峰网
雷峰网
Security Latest
Security Latest
小众软件
小众软件
J
Java Code Geeks
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Spread Privacy
Spread Privacy
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
The Blog of Author Tim Ferriss
M
MIT News - Artificial intelligence

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How I Built a Permanent Testing Server Using Cloudflare Tunnel
Om Dongaonkar · 2026-05-31 · via DEV Community

At work, we were constantly running into the same problem. A tester needs to check something, a client wants to preview a build, someone's on a different network - and the only options were spinning up a cloud server (overkill for testing), using ngrok (URLs die the moment you close the terminal), or asking everyone to physically come to the machine. None of these were sustainable.

So I set up a proper testing infrastructure using Cloudflare Tunnel on a spare Windows machine we had. Every project now has a permanent public HTTPS URL, accessible from anywhere in the world, that survives reboots - zero cloud cost.

Here's exactly how I built it.


How It All Connects

Before getting into the setup, it helps to understand the architecture:

Tester anywhere in the world
           │
           ▼
project1.yourdomain.com        ← Cloudflare DNS
           │
           ▼
Cloudflare Network             ← forwards via tunnel
           │
           ▼
cloudflared on spare machine   ← tunnel client, always running
           │
           ▼
localhost:3001                 ← Apache or Node serving the project
           │
           ▼
Your actual project code

The key insight: the machine reaches OUT to Cloudflare, not the other way around. Your ISP never sees incoming traffic. Nothing to port-forward, nothing to block.


Prerequisites

  • A spare Windows machine (always-on)
  • XAMPP installed (Apache only needed, MySQL optional)
  • A domain you own
  • A free Cloudflare account
  • cloudflared CLI (download from GitHub)
  • Node.js + PM2 (only if you have Node projects)

Part A - Connect Your Domain to Cloudflare

This is a one-time step. After this, all DNS management happens on Cloudflare.

1. Add your domain to Cloudflare

Login to cloudflare.com → Add a Site → enter your domain → select Free plan. Cloudflare will scan your existing DNS records automatically.

2. Get your nameservers

Cloudflare will give you two nameservers like:

ns1.cloudflare.com
ns2.cloudflare.com

3. Point your registrar to Cloudflare

Go to your domain registrar (GoDaddy, Namecheap, etc.) → find the nameserver settings → replace them with the two Cloudflare nameservers.

DNS propagation takes anywhere from 5 minutes to a few hours. After this, your domain is fully managed by Cloudflare and you never touch the registrar for DNS again.

Note: Any existing DNS records (MX records for email etc.) were copied by Cloudflare during the scan. Your existing services won't break.


Part B - XAMPP Virtual Hosts for PHP Projects

By default Apache serves everything from port 80 under /htdocs. Virtual Hosts let each project get its own port so the routing logic in your PHP code needs zero changes.

Before:

localhost/project1 → htdocs/project1
localhost/project2 → htdocs/project2

After:

localhost:3001 → htdocs/project1 (project thinks it's at /)
localhost:3002 → htdocs/project2 (project thinks it's at /)

Step 1 - Add extra ports to Apache

Open C:\xampp\apache\conf\httpd.conf and find the Listen section:

Listen 80
Listen 3001
Listen 3002
Listen 3003
# Add one line per project

Step 2 - Enable the virtual hosts include

In the same file, make sure this line is not commented out:

Include conf/extra/httpd-vhosts.conf

Step 3 - Configure virtual hosts per project

Open C:\xampp\apache\conf\extra\httpd-vhosts.conf and add a block for each project:

<VirtualHost *:3001>
    DocumentRoot "C:/xampp/htdocs/project1"
    <Directory "C:/xampp/htdocs/project1">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:3002>
    DocumentRoot "C:/xampp/htdocs/project2"
    <Directory "C:/xampp/htdocs/project2">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Step 4 - Restart Apache and verify

Open XAMPP Control Panel → Stop Apache → Start Apache. Then open http://localhost:3001 in your browser - you should see your project homepage.

Troubleshooting: If you get 403 Forbidden, double check AllowOverride All and Require all granted are in the Directory block. If Apache won't start, check port conflicts: netstat -ano | findstr :3001

Step 5 - Make Apache auto-start on boot

In XAMPP Control Panel, click the checkbox under the Svc column next to Apache → click Yes. Apache now starts automatically every time Windows boots.


Part C - PM2 for Node Projects

Skip this part if you have no Node.js projects.

PM2 is a process manager that keeps Node apps running permanently and restarts them automatically after crashes or reboots.

Install PM2

npm install -g pm2
npm install -g pm2-windows-startup

Start your Node project

cd C:\projects\myapp
pm2 start server.js --name myapp

Set the port in your app

const PORT = process.env.PORT || 3002;
app.listen(PORT, () => console.log(`Running on ${PORT}`));

Each Node project gets its own port number - same as Apache virtual hosts.

Save and auto-start on boot

pm2 save
pm2-startup install

Useful PM2 commands:

Command What it does
pm2 list See all running projects
pm2 logs myapp Live logs for a project
pm2 restart myapp Restart after code changes
pm2 monit Live CPU/memory dashboard

Part D - Cloudflare Tunnel Setup

This is the core of the whole thing. One-time setup - after this, subdomains are permanent and survive reboots forever.

Step 1 - Install cloudflared

Download cloudflared-windows-amd64.exe from the GitHub releases page, rename it to cloudflared.exe, and place it at C:\cloudflared\cloudflared.exe.

Add it to your system PATH:

  1. Open Start → search Environment Variables
  2. Under System Variables find Path → Edit
  3. Add C:\cloudflared

Verify the install:

cloudflared --version

Step 2 - Login to Cloudflare

cloudflared tunnel login

This opens your browser. Authorize the account where your domain lives. A certificate is saved automatically at C:\Users\YourUser\.cloudflared\cert.pem.

Step 3 - Create a tunnel

You only need one tunnel for all projects if you use a single config file (recommended):

cloudflared tunnel create testing-server

This outputs a tunnel ID (a long UUID). Note it down - you'll need it in the config file.

Step 4 - Map subdomains to the tunnel

cloudflared tunnel route dns testing-server project1.yourdomain.com
cloudflared tunnel route dns testing-server project2.yourdomain.com

This automatically creates the DNS records on Cloudflare. You don't need to touch the dashboard. These subdomains are now permanent - they survive reboots and restarts.

Step 5 - Create the config file

Create C:\Users\YourUser\.cloudflared\config.yml:

tunnel: testing-server
credentials-file: C:\Users\YourUser\.cloudflared\<tunnel-id>.json

ingress:
  - hostname: project1.yourdomain.com
    service: http://localhost:3001
  - hostname: project2.yourdomain.com
    service: http://localhost:3002
  - hostname: nodeapp.yourdomain.com
    service: http://localhost:4000
  - service: http_status:404

Replace <tunnel-id> with the actual UUID from Step 3.

Step 6 - Test run

cloudflared tunnel --config C:\Users\YourUser\.cloudflared\config.yml run

Open project1.yourdomain.com in your browser. If your site loads, the tunnel is working. Press Ctrl+C to stop.

Step 7 - Run as a Windows service

cloudflared service install
net start cloudflared

This registers cloudflared as a Windows service that starts on boot. From this point, everything is permanent and automatic.


Part E - Adding a New Project

Every time you add a project, this is the checklist. Takes about 5 minutes.

For a PHP project:

  1. Create folder at C:\xampp\htdocs\projectX
  2. Add Listen 300X to httpd.conf
  3. Add <VirtualHost *:300X> block to httpd-vhosts.conf
  4. Restart Apache from XAMPP Control Panel
  5. Add new hostname entry to config.yml
  6. Restart cloudflared: net stop cloudflared && net start cloudflared
  7. Open projectX.yourdomain.com to verify

For a Node project:

  1. Place project at C:\projects\projectX
  2. Set PORT=300X in .env
  3. pm2 start server.js --name projectX
  4. pm2 save
  5. Add new hostname entry to config.yml
  6. Restart cloudflared: net stop cloudflared && net start cloudflared
  7. Open projectX.yourdomain.com to verify

Troubleshooting

Issue Fix
Site not loading Check Apache is running in XAMPP + net start cloudflared
403 Forbidden Check AllowOverride All and Require all granted in vhosts config
502 Bad Gateway Node app not running - check pm2 list
Port conflict `netstat -ano
Tunnel not connecting Re-run {% raw %}cloudflared tunnel login - cert may have expired
Node crashes on reboot Re-run pm2 save and pm2-startup install
Changes not showing (PHP) Restart Apache after any .conf edits
Changes not showing (Node) pm2 restart projectX after code changes

Result

Every project on the machine has a permanent public HTTPS URL. Testers can open the site from anywhere in the world - no same-WiFi requirement, no cloud bill, no manual steps after the initial setup.

The most underrated part is how invisible it becomes once it's running. Nobody has to think about infrastructure. It just works.