<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Bangsaen AI Lab]]></title><description><![CDATA[Bangsaen AI Lab]]></description><link>https://bangsaenai.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 29 Oct 2026 03:43:48 GMT</lastBuildDate><atom:link href="https://bangsaenai.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I Compiled C++ to WebAssembly on Cloudflare Edge to Kill Bots with 0.000ms Origin Overhead]]></title><description><![CDATA[Every web service faces the same annoying issue: AI scrapers, automated brute-force bots, and bad actors eating up origin server CPU & RAM before they even…]]></description><link>https://bangsaenai.hashnode.dev/how-i-compiled-c-to-webassembly-on-cloudflare-edge-to-kill-bots-with-0-000ms-origin-overhead</link><guid isPermaLink="true">https://bangsaenai.hashnode.dev/how-i-compiled-c-to-webassembly-on-cloudflare-edge-to-kill-bots-with-0-000ms-origin-overhead</guid><category><![CDATA[WebAssembly]]></category><category><![CDATA[#cpp20]]></category><category><![CDATA[cloudflare]]></category><category><![CDATA[cybersecurity]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Bangsaen AI]]></dc:creator><pubDate>Thu, 23 Jul 2026 03:36:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a61890224c416dfc1cfca7b/e8e7050f-7be7-418e-84d4-546d24c288f3.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every web service faces the same annoying issue: <strong>AI scrapers, automated brute-force bots, and bad actors eating up origin server CPU &amp; RAM</strong> before they even get blocked.</p>
<p>Traditional middleware (like PHP or Node.js security plugins) still forces your origin host to execute code just to decide whether to drop a request. That’s wasted computing resources.</p>
<p>I wanted to solve this with a strict rule: <strong>Zero host CPU impact on the origin server.</strong></p>
<p>Here is how I compiled a C++ kernel to WebAssembly (WASM) and deployed it directly to Cloudflare Global Edge.</p>
<hr />
<h2>🏗️ The Architecture</h2>
<p>Instead of filtering traffic at the origin, the protection layer is pushed to Cloudflare’s 300+ Edge locations globally.</p>
<p>[ Incoming Request ]
│
▼
[ Cloudflare Global Edge ]
│ ──► [ C++ WASM Kernel Inspection ] ──► (Blocked if Bot)
▼
[ Your Origin Server ] (0.000ms CPU Impact!)</p>
<h3>Why C++ WebAssembly on the Edge?</h3>
<ol>
<li><strong>Ultra-Low Latency:</strong> Executing C++ compiled to WASM delivers sub-millisecond execution (<code>0.000ms</code> kernel impact).</li>
<li><strong>Instant Dropping:</strong> Bad actors are terminated at the nearest edge node—never reaching your actual server stack.</li>
<li><strong>Language Efficiency:</strong> C++ provides predictable memory usage and near-bare-metal speeds compared to standard V8 JavaScript isolates.</li>
</ol>
<hr />
<h2>⚡ Try it with cURL</h2>
<p>You can inspect the response directly from your terminal:</p>
<pre><code class="language-bash">curl -X POST [https://bangsaen-bot-killer.bangsaen-filter.workers.dev](https://bangsaen-bot-killer.bangsaen-filter.workers.dev) \
  -H "x-bangsaen-key: YOUR_API_KEY"
</code></pre>
<p>Sample JSON Response:</p>
<p>{
  "status": "Success",
  "botDetected": false,
  "score": "0.0000",
  "executionTime": "0.000ms"
}</p>
<p>🔌 What's Next &amp; Free Tier
I've made the API gateway available with a Free Tier (100,000 requests/month) so developers can offload scraper mitigation without paying a dime or using a credit card.</p>
<p>🌐 Live Demo &amp; API Key: bangsaenai.com</p>
<p>🔌 WordPress Users: We have submitted the official Bangsaen Filter plugin to the WordPress.org directory—currently under manual review and scheduled to launch in ~5 days!</p>
<p>Would love to hear your thoughts on latency optimization and edge security architecture!</p>
]]></content:encoded></item></channel></rss>