Overview
Thetarpit responder streams data to clients at an extremely slow rate, effectively trapping them in a time-consuming connection. This wastes bot resources, stalls scrapers, and can pollute AI training datasets when combined with custom content.
Configuration Options
| Option | Required | Default | Description |
|---|---|---|---|
headers | No | - | Custom HTTP headers to include in the response |
content | No | Random data | Content source (file:// or https://) |
timeout | No | 30s | Maximum duration before ending the connection |
bytes_per_second | No | 24 | Rate at which data is streamed |
response_code | No | 200 | HTTP status code to return |
The
tarpit_config block is required when using the tarpit responder.When to Use
Use thetarpit responder when:
- You want to waste bot/scraper resources with slow responses
- You want to tie up bot connections for extended periods
- You want to pollute AI training with specific misleading content
- You want to make scraping your site extremely expensive and slow
How It Works
- A request from a matching IP range is received
- The server responds with headers immediately (appears to be working)
- Data is streamed at the configured slow rate (default: 24 bytes/second)
- The connection remains open until timeout or content EOF
- Bot resources are tied up for the entire duration
Configuration Examples
- Caddyfile
- JSON
Example 1: Basic Tarpit with Local File
- Serves content from a local file at 24 bytes/second
- Adds a custom header to the response
- Times out after 30 seconds if the file hasn’t finished streaming
- Returns HTTP 200 to appear legitimate
Example 2: Tarpit with Remote Content
- Fetches content from a remote HTTPS source (cached locally)
- Streams Cloudflare’s robots.txt at a glacial pace
- Can be used to feed misleading content to AI scrapers
Real-World Scenarios
Performance Considerations
Each tarpit connection consumes server resources for the entire timeout duration. Monitor your server capacity and adjust the timeout and bytes_per_second values accordingly.
Recommended Settings
- Light defense:
bytes_per_second: 100,timeout: 10s - Medium defense:
bytes_per_second: 24,timeout: 30s(default) - Aggressive defense:
bytes_per_second: 5,timeout: 120s - Maximum annoyance:
bytes_per_second: 1,timeout: 300s
Content Sources
Thecontent field supports multiple source types:
- Local files:
file:///path/to/file.txt - HTTPS URLs:
https://example.com/content.txt(cached locally) - HTTP URLs:
http://example.com/content.txt(cached locally) - Omitted: Random garbage data is generated