🛡️ Adblock Compiler

Compiler-as-a-Service | Real-time filter list compilation with event-driven pipeline

Powered by Cloudflare Workers • API

Quick Start: Paste filter list URLs (one per line) or raw rules directly, select transformations, and compile!
Enter URLs or paste rules directly. Mix and match as needed.
Advanced Mode: Provide a full JSON configuration for maximum control over sources, transformations, and filters.
Enter a complete configuration JSON. See documentation for all options.
Examples: Click any example to load it into the compiler.

Basic Compilation

Simple URL-based compilation with standard transformations

Hosts File Conversion

Convert /etc/hosts format to AdGuard syntax

Raw Rules

Compile directly from pasted filter rules

Multiple Sources

Combine multiple filter lists with different transformations

With Exclusions

Filter out unwanted rules using exclusions

Compiler-as-a-Service: Real-time event pipeline for observability and monitoring

🔄 Event Pipeline

Our compiler uses Server-Sent Events (SSE) to provide real-time progress updates throughout the compilation process.

Event Types

source:start - Fires when fetching a source begins

source:complete - Source successfully fetched and parsed

source:error - Source fetching or parsing failed

transformation:start - Transformation begins (e.g., Deduplicate)

transformation:complete - Transformation finished

progress - General progress updates with current phase

result - Final compilation results with rules and metrics

done - Compilation process complete

error - Fatal error occurred

API Endpoints

Base URL: https://adblock-compiler.jayson-knight.workers.dev

POST /compile

Compile filter lists and return complete results as JSON

curl -X POST https://adblock-compiler.jayson-knight.workers.dev/compile \\
  -H "Content-Type: application/json" \\
  -d '{
    "configuration": {
      "name": "My Filter List",
      "sources": [{"source": "https://example.com/filters.txt"}],
      "transformations": ["Deduplicate", "RemoveEmptyLines"]
    },
    "benchmark": true
  }'

POST /compile/stream

Compile with real-time Server-Sent Events for progress tracking

const eventSource = new EventSource('/compile/stream');

eventSource.addEventListener('source:start', (e) => {
  const data = JSON.parse(e.data);
  console.log('Fetching:', data.source.name);
});

eventSource.addEventListener('result', (e) => {
  const data = JSON.parse(e.data);
  console.log('Compiled', data.ruleCount, 'rules');
});

Try It Now

Switch to Simple Mode or Advanced Mode and compile a list. Watch the "Compilation Progress" section below to see the event pipeline in action!

✨ Live Demo: Every compilation on this page uses the SSE event pipeline. The progress bar and logs you see are powered by real-time events from our compiler.

Available Transformations

Transformations are applied in the following fixed order:

  1. ConvertToAscii - Convert internationalized domains
  2. TrimLines - Remove whitespace
  3. RemoveComments - Strip comments
  4. Compress - Convert hosts to adblock syntax
  5. RemoveModifiers - Remove unsupported modifiers
  6. InvertAllow - Convert to allowlist
  7. Validate - Remove invalid rules
  8. ValidateAllowIp - Validate but keep IPs
  9. Deduplicate - Remove duplicates
  10. RemoveEmptyLines - Clean empty lines
  11. InsertFinalNewLine - Add final newline

CORS & Rate Limits

CORS: All endpoints support CORS with Access-Control-Allow-Origin: *

Rate Limits: No hard limits currently. Execution timeout: 50 seconds

Resources

📚 GitHub Repository

🌐 Web UI

API Info Endpoint

Compilation Progress

Compilation Results