Overview
Discover what makes Privoxy powerful
Privoxy is a lightweight, non‑caching HTTP/HTTPS proxy designed to enhance privacy and control over web traffic. At its core, it intercepts client requests, rewrites URLs and headers, blocks unwanted content (ads, trackers, malware), and forwards the modified traffic to the target server. Unlike full‑blown caching proxies such as Squid, Privoxy deliberately avoids storing any content, which simplifies its state model and reduces disk I/O overhead. The proxy operates on a single listening port, typically `8118`, and communicates with clients using the standard HTTP/1.1 protocol, making it compatible with virtually any browser or application that can be configured to use a proxy.
Language & Runtime
Configuration Engine
No External Database
Event Loop
Overview
Privoxy is a lightweight, non‑caching HTTP/HTTPS proxy designed to enhance privacy and control over web traffic. At its core, it intercepts client requests, rewrites URLs and headers, blocks unwanted content (ads, trackers, malware), and forwards the modified traffic to the target server. Unlike full‑blown caching proxies such as Squid, Privoxy deliberately avoids storing any content, which simplifies its state model and reduces disk I/O overhead. The proxy operates on a single listening port, typically 8118, and communicates with clients using the standard HTTP/1.1 protocol, making it compatible with virtually any browser or application that can be configured to use a proxy.
Architecture
- Language & Runtime: Privoxy is written in ANSI C, ensuring minimal runtime dependencies and high performance on a wide range of platforms (Linux, BSD, macOS, Windows). The codebase is modular, with separate compilation units for network I/O, rule parsing, and request handling.
- Configuration Engine: The proxy loads a series of text‑based configuration files (
config,user.filter,regexp.action) at startup. These files are parsed by a custom lexer/parser that converts user rules into an internal trie‑based data structure for efficient lookup during request processing. - No External Database: All state is kept in memory; there is no requirement for a database server. Persistent settings are stored as plain text, which simplifies deployment and version control.
- Event Loop: Privoxy uses a single‑threaded event loop based on
select()/poll(). While this limits concurrent connection throughput compared to multi‑threaded proxies, it keeps the code simple and avoids race conditions.
Core Capabilities
- Header Manipulation: Developers can add, modify, or delete HTTP headers on both inbound and outbound traffic. This is useful for stripping tracking cookies (
Cookie) or injecting custom authentication tokens. - URL & Content Filtering: Using regular expressions and simple rule syntax, Privoxy can block or rewrite URLs, remove specific HTML elements, or replace entire resource blocks. These rules are evaluated in a deterministic order defined by the configuration files.
- Access Control: The proxy supports IP‑based access lists, allowing administrators to whitelist or blacklist clients. This is implemented through simple CIDR matching in the request handling loop.
- Proxying HTTPS: Privoxy supports CONNECT tunneling for HTTPS traffic. While it does not terminate TLS, developers can combine it with tools like
stunnelormitmproxyfor deeper inspection. - Logging & Statistics: A built‑in logging facility records requests, responses, and rule matches. Log rotation is handled by the operating system’s syslog or via external log management tools.
Deployment & Infrastructure
- Self‑Hosting: Privoxy runs as a standalone daemon, requiring only the standard C runtime and networking stack. It can be installed from source or binary packages (available on SourceForge, mirrors, and the official site).
- Containerization: Official Docker images are maintained by community contributors. The minimal footprint (under 10 MB for Alpine‑based images) makes it ideal for microservice architectures and Kubernetes deployments. Containers expose a single port and can be chained with other proxies or load balancers.
- Scalability: Because Privoxy is single‑threaded, horizontal scaling (multiple instances behind a load balancer) is the recommended approach for high‑traffic environments. Each instance can be stateless, allowing easy replication and failover.
- Resource Usage: Memory consumption is proportional to the size of rule sets. A typical installation with a moderate filter list uses < 20 MB RAM, making it suitable for embedded devices or IoT gateways.
Integration & Extensibility
- Plugin System: While Privoxy itself has no native plugin API, developers can extend its functionality by writing custom C modules that hook into the request/response pipeline. These modules are loaded via the
includedirective in the configuration. - External APIs: Integration with external services (e.g., DNS blacklists, ad‑block lists) is achieved by periodically fetching rule files and reloading the configuration. Scripts can trigger
privoxy --reloadto apply changes without downtime. - Webhooks: Some community builds expose a simple HTTP API for status checks or dynamic rule updates. Developers can build on top of this to create automated policy engines.
- Customization: The entire behavior is governed by text files, enabling version control and automated deployment. Advanced users can craft complex transformation chains (e.g., conditional header injection based on URL patterns).
Developer Experience
- Documentation: The official site hosts a comprehensive developer manual, user guide, and FAQ. Documentation is written in plain text and HTML, with examples for every configuration directive.
- Community & Support: Privoxy is an SPI (Software in the Public Interest) project with active mailing lists, IRC channels, and a GitHub repository. Bug reports are triaged quickly, and the codebase follows GNU GPLv2 licensing, encouraging derivative works.
- Configuration Simplicity: The rule syntax is intentionally minimalistic, reducing the learning curve. Complex logic can be expressed through nested
forwardandrejectdirectives, while simple filters use regular expressions. - Testing: Unit tests cover rule parsing and request handling. Continuous integration pipelines run on multiple platforms, ensuring cross‑compatibility.
Use Cases
- Enterprise Privacy Gateways – Deploy Privoxy as a front‑end to block corporate ads, trackers, and enforce header policies before traffic reaches the internal network.
- Ad‑Blocker for IoT – Run a lightweight instance on a home
Open SourceReady to get started?
Join the community and start self-hosting Privoxy today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
DavMail
Gateway for Exchange and Office 365 using POP/IMAP/SMTP
VoucherVault
Digital voucher and loyalty card manager
Databag
Federated, end‑to‑end encrypted messenger for self‑hosting
2FAuth
Self‑hosted 2FA manager for desktop and mobile
Sunshine
Self-hosted low-latency game streaming for Moonlight
gobookmarks
Personal landing page with GitHub‑backed bookmarks
