A MITMProxy addon that automatically replaces false with true in HTTP responses. Useful for testing, debugging, or having some fun with web applications.
- π Replaces
falsewithtruein HTTP responses - π― Smart content-type detection (JSON, HTML, JavaScript, XML, etc.)
- π‘οΈ Preserves JSON structure when possible
- π Logging and statistics
- π« Skips binary content (images, videos, etc.)
- π§ Configurable via command-line options
- π³ Docker container support
- βοΈ GitHub Container Registry (GHCR) hosted images
- Python 3.7+
- pip
git clone https://github.com/SakuraNekooo/false2true-proxy.git
cd false2true-proxy
pip install -r requirements.txtpip install mitmproxy# Pull from GitHub Container Registry
docker pull ghcr.io/sakuranekooo/false2true-proxy:latest
# Or build locally
docker build -t false2true-proxy .mitmdump -s mitm_false2true.pymitmproxy -s mitm_false2true.py# Basic usage
docker run -p 8080:8080 ghcr.io/sakuranekooo/false2true-proxy:latest
# Custom port
docker run -p 8888:8080 ghcr.io/sakuranekooo/false2true-proxy:latest --listen-port 8888
# Persist mitmproxy data
docker run -p 8080:8080 -v mitmproxy-data:/home/mitmuser/.mitmproxy ghcr.io/sakuranekooo/false2true-proxy:latest
# Save traffic to file
docker run -p 8080:8080 -v ./traffic:/home/mitmuser/.mitmproxy ghcr.io/sakuranekooo/false2true-proxy:latest -w /home/mitmuser/.mitmproxy/traffic.mitm# Start with docker-compose
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose downapiVersion: apps/v1
kind: Deployment
metadata:
name: false2true-proxy
spec:
replicas: 1
selector:
matchLabels:
app: false2true-proxy
template:
metadata:
labels:
app: false2true-proxy
spec:
containers:
- name: false2true-proxy
image: ghcr.io/sakuranekooo/false2true-proxy:latest
ports:
- containerPort: 8080
env:
- name: MITMPROXY_VERBOSE
value: "false"- Configure your browser/system to use the proxy at
127.0.0.1:8080 - Install the MITMProxy CA certificate (mitmproxy will guide you)
- Start browsing - all
falsevalues will becometrue!
# Run on a different port
mitmdump -s mitm_false2true.py --listen-port 8888
# Verbose logging
mitmdump -s mitm_false2true.py -v
# Save modified traffic to file
mitmdump -s mitm_false2true.py -w modified_traffic.mitm
# Docker with custom options
docker run -p 8080:8080 ghcr.io/sakuranekooo/false2true-proxy:latest --set block_global=false -vThe Docker image is available on GitHub Container Registry:
Primary Image: ghcr.io/sakuranekooo/false2true-proxy:latest
Available Tags:
latest- Latest stable releasev1.x.x- Version tags (e.g., v1.0.0)sha-xxxxxx- Commit SHA tagsmain- Latest from main branch
Pull Command:
docker pull ghcr.io/sakuranekooo/false2true-proxy:latestThe addon intercepts HTTP responses and:
- Checks if the content-type is text-based (JSON, HTML, JS, XML, etc.)
- Decodes the response content
- Replaces all occurrences of
falsewithtrue(andFalsewithTrue) - For JSON responses, it also converts boolean
falsetotrue - Returns the modified response to the client
{
"success": false,
"enabled": false,
"count": 0,
"message": "Operation failed",
"items": []
}{
"success": true,
"enabled": true,
"count": 0,
"message": "Operation failed",
"items": []
}var isReady = false;
var hasError = false;var isReady = true;
var hasError = true;- π§ͺ Testing how applications behave when APIs always return
true - π Debugging optimistic UI states
- π Pranks (use responsibly!)
- π¬ Research on client-side validation
- π οΈ Development and prototyping
- π³ Containerized testing environments
- βοΈ Cloud-native application testing
FALSE2TRUE_PORT- Proxy port (default: 8080)FALSE2TRUE_VERBOSE- Enable verbose loggingMITMPROXY_VERBOSE- MITMProxy verbose mode
docker run -e MITMPROXY_VERBOSE=true -p 8080:8080 ghcr.io/sakuranekooo/false2true-proxy:latestBy default, the addon processes these content types:
text/*(all text types)application/jsonapplication/javascriptapplication/xmlapplication/xhtml+xml
false2true-proxy/
βββ mitm_false2true.py # Main MITMProxy addon
βββ requirements.txt # Python dependencies
βββ Dockerfile # Docker image definition
βββ docker-compose.yml # Docker Compose configuration
βββ .dockerignore # Docker ignore file
βββ README.md # This file
βββ .gitignore # Git ignore file
βββ .github/workflows/ # CI/CD workflows
β βββ docker.yml # Docker build and push workflow
βββ examples/ # Example configurations
β βββ custom_rules.py # Example of custom rules
β βββ test_server.py # Simple test server
βββ tests/ # Test files
βββ test_addon.py # Unit tests
python -m pytest tests/# Build image
docker build -t false2true-proxy .
# Run tests
docker run --rm false2true-proxy --version
# Run with test server
docker-compose upThe project includes GitHub Actions workflow that:
- Builds Docker image on push to main
- Runs security scans
- Pushes to GitHub Container Registry
- Creates releases on version tags
- Follow PEP 8
- Use type hints where possible
- Add docstrings to functions and classes
- Only use on networks and applications you own or have permission to test
- The MITMProxy CA certificate must be installed in the client browser/device
- This will break SSL/TLS verification unless the certificate is trusted
- Some applications may behave unexpectedly when
falsebecomestrue - Docker containers run as non-root user for security
Run MITMProxy and follow the instructions to install its CA certificate.
- Check that the proxy is correctly configured
- Verify the content-type is being processed
- Enable verbose logging with
-v
# Check container logs
docker logs <container_name>
# Check if container is running
docker ps | grep false2true-proxy
# Run with interactive shell for debugging
docker run -it --entrypoint /bin/bash ghcr.io/sakuranekooo/false2true-proxy:latestThe addon adds minimal overhead. For high-traffic scenarios, consider:
- Using
mitmdumpinstead ofmitmproxy(non-interactive) - Adding domain whitelisting in the code
- Adjusting Docker resource limits
MIT License - see LICENSE file for details.
Contributions are welcome! Please see CONTRIBUTING.md for details.
- MITMProxy for the amazing proxy framework
- Docker for containerization
- GitHub Actions for CI/CD
- All contributors and users of this project
Note: This tool is for educational and testing purposes only. Use responsibly and with proper authorization.