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
🔄 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!
Available Transformations
Transformations are applied in the following fixed order:
- ConvertToAscii - Convert internationalized domains
- TrimLines - Remove whitespace
- RemoveComments - Strip comments
- Compress - Convert hosts to adblock syntax
- RemoveModifiers - Remove unsupported modifiers
- InvertAllow - Convert to allowlist
- Validate - Remove invalid rules
- ValidateAllowIp - Validate but keep IPs
- Deduplicate - Remove duplicates
- RemoveEmptyLines - Clean empty lines
- 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