Overview
This responder is highly flexible, allowing you to craft specific responses for different scenarios. Whether you want to return a friendly message with 200 OK, pretend the resource doesn’t exist with 404, or indicate legal restrictions with 451, the Custom responder handles it all.Configuration
The custom text message to return to blocked clients.This field is required when using the Custom responder.
The HTTP status code to return.Can be any valid HTTP status code (e.g., 200, 403, 404, 451, 503).Default:
200IP ranges to target. Can be CIDR notations or predefined service keys.Default:
["aws", "azurepubliccloud", "deepseek", "gcloud", "githubcopilot", "openai"]Optional list of specific IP addresses to exclude from the custom response.Default:
[]HTTP Response
The Custom responder sets:The configured
status_code (default: 200)The configured
message texttext/plain
Examples
Implementation Details
The Custom responder is implemented inresponders/custom.go:20:
Common Status Codes
| Code | Name | Use Case |
|---|---|---|
| 200 | OK | Polite message without indicating an error |
| 403 | Forbidden | Explicit access denial |
| 404 | Not Found | Stealth mode - hide that the resource exists |
| 451 | Unavailable For Legal Reasons | Geographic or legal restrictions |
| 503 | Service Unavailable | Maintenance or temporary blocking |
Use Cases
Polite Blocking (200 OK)
Return a friendly message without triggering error handling in client applications:Stealth Mode (404 Not Found)
Make scrapers think the content doesn’t exist:Legal Compliance (451)
Indicate content is unavailable due to legal reasons:Maintenance Mode (503)
Temporarily block all traffic during maintenance:Comparison with Other Responders
- vs Block: Custom allows any status code and message, Block is fixed at 403
- vs Drop: Custom sends a proper HTTP response, Drop terminates the connection
- vs Redirect: Custom returns content, Redirect sends clients elsewhere
- vs Garbage: Custom returns meaningful text, Garbage returns random data
Best Practices
- Use 200 for soft blocking - Avoids triggering retry logic in well-behaved bots
- Use 404 for stealth - Makes scrapers think content doesn’t exist
- Use 403 for explicit denial - Clear signal that access is intentionally blocked
- Keep messages short - Reduces bandwidth for blocked requests
- Match status to intent - Use semantically appropriate HTTP status codes
Related Documentation
- Block Responder - Simple 403 blocking
- Redirect Responder - Send users elsewhere
- HTTP Status Codes - Full list of status codes