Fapwall 0.9 May 2026
#!/usr/bin/env python3
"""
A minimal HTTP/HTTPS proxy that uses FapWall to block requests.
Requires: mitmproxy (pip install mitmproxy)
Run: mitmdump -s examples/simple_proxy.py
"""
from mitmproxy import http
from fapwall.core import FapWall
import yaml, json, logging
log = logging.getLogger("fapwall_proxy")
log.setLevel(logging.INFO)
# Load config once
with open("fapwall/config.yaml") as f:
cfg = yaml.safe_load(f)
engine = FapWall(cfg)
def request(flow: http.HTTPFlow):
# Grab basic info
url = flow.request.pretty_url
title = "" # not available yet – will be checked after response
body = "" # will be filled later if needed
# Preliminary URL check
decision = engine.inspect(url=url, title=title, body=body)
if decision["blocked"]:
flow.response = http.HTTPResponse.make(
403,
b"Blocked by fapwall 0.9 – content not allowed.",
"Content-Type": "text/plain"
)
log.info(f"Blocked request: url (reason: decision['reasons'])")
def response(flow: http.HTTPFlow):
# Run after the server answered – we can now inspect title / body
if flow.response.status_code != 200:
return
# Try to decode as text (ignore binary files)
try:
body_text = flow.response.get_text()
except Exception:
return
# Extract a crude title if it's HTML
title = ""
if "text/html" in flow.response.headers.get("content-type", ""):
import re
m = re.search(r"<title>(.*?)</title>", body_text, re.IGNORECASE | re.DOTALL)
if m:
title = m.group(1).strip()
decision = engine.inspect(
url=flow.request.pretty_url,
title=title,
body=body_text,
)
if decision["blocked"]:
flow.response = http.HTTPResponse.make(
403,
b"Blocked by fapwall 0.9 – content not allowed.",
"Content-Type": "text/plain"
)
log.info(f"Blocked response: flow.request.pretty_url (reason: decision['reasons'])")
How to run the demo
# 1️⃣ Install deps
pip install -r requirements.txt
# 2️⃣ Start the proxy (listens on 127.0.0.1:8080 by default)
mitmdump -s examples/simple_proxy.py
# 3️⃣ Configure your browser or OS to use 127.0.0.1:8080 as HTTP/HTTPS proxy.
One of the most praised aspects of Fapwall 0.9 was its built-in thumbnailer. At a time when image processing was server-intensive, version 0.9 introduced a batch processing mode that allowed webmasters to generate hundreds of thumbnails without crashing their server. fapwall 0.9
You might suspect an overzealous or malicious colleague has deployed Fapwall 0.9. Here’s how to check: How to run the demo # 1️⃣ Install