# ublproxy
A network-wide adblock proxy-server w. adblock list support, custom rules and passkey users. Easy to set up and host yourself.
## Problem domain
Browsers were supposed to be "user-agents", but modern browsers are far more catered to ad-selling corporations, than they are to users.
Existing solutions, such as [pihole](https://pi-hole.net/) and other dns-based solutions are only sufficient, if you want to block an entire hostname. Browser extensions used to work well, but with the latest [Manifest changes](https://adlock.com/blog/chrome-killing-adblock/), they are not as effective as they used to be.
## Architecture
ublproxy sits between your devices and the internet, intercepting HTTP/HTTPS traffic to block ads and tracking at the network level. It operates in three modes:
### Explicit proxy mode (default)
Browsers are configured to send traffic through the proxy via PAC files or manual proxy settings.
```mermaid
graph LR
D1["Desktop"] --> P
D2["Laptop"] --> P
D3["Phone"] --> P
subgraph P["ublproxy :8443 / :8080"]
BL["Blocklist
Engine"]
CA["CA + Cert
Cache"]
end
P --> UP["Internet"]
```
### Transparent proxy mode (`--transparent`)
A firewall redirects all traffic from a VLAN to the proxy. No client configuration needed.
```mermaid
graph LR
D["Device"] --> FW["Firewall"]
FW -->|"redirect
:80 + :443"| P["ublproxy"]
P --> UP["Internet"]
```
### DNS resolver (`--dns-port`)
For devices that can't install a CA certificate. Blocked hostnames return `0.0.0.0`, everything else is forwarded upstream.
```mermaid
graph LR
D1["Smart TV"] --> P
D2["IoT"] --> P
subgraph P["ublproxy :53"]
BL["Blocklist
Engine"]
end
P -->|"forward"| UP["Upstream
DNS"]
```
## Features
### Adblock filter lists
Subscribe to community-maintained blocklists like EasyList, EasyPrivacy, and uBlock Filters. Lists are fetched and parsed automatically. Supports the [Adblock Plus filter syntax](https://adblockplus.org/filter-cheatsheet) and many [uBlock Origin extensions](https://github.com/gorhill/uBlock/wiki/Static-filter-syntax) — see [ADBLOCK_SYNTAX.md](ADBLOCK_SYNTAX.md) for the full matrix.
### Custom rules
Add your own blocking and element-hiding rules using adblock filter syntax, or use the interactive element picker (Alt+Shift+B) to visually select elements to hide on any proxied page.
### Encrypted, all the way
Desktop browsers connect to the proxy over HTTPS. The proxy generates per-host TLS certificates on the fly using its own CA. Mobile devices (iOS/Android) connect over plain HTTP because they don't support HTTPS proxy connections — the MITM tunnel within the connection is still TLS-encrypted.
### Strips away scripts, images and embeds
Blocked requests for scripts, images, iframes and other embedded resources are stopped at the proxy before they reach your browser. Blocked resources can be replaced with neutered placeholders (`$redirect`) to satisfy anti-adblock detection.
### Hides the rest
CSS is injected into HTML responses to hide elements matching element-hiding rules. The proxy decompresses HTML (gzip, brotli, zstd), injects the CSS, and serves it back — removing ad containers, banners and other unwanted elements visually.
### Scriptlet injection
11 commonly-used scriptlets (`##+js()`) are injected as `