Crates.io | adblock-rust-server |
lib.rs | adblock-rust-server |
version | 0.3.1 |
source | src |
created_at | 2021-03-01 19:16:18.761838 |
updated_at | 2021-05-29 18:38:37.173073 |
description | Server wrapper around the adblock crate using Unix domain sockets |
homepage | |
repository | https://github.com/dudik/adblock-rust-server |
max_upload_size | |
id | 362338 |
size | 66,853 |
Server wrapper for the adblock crate using Unix domain sockets.
Created for blockit, but can be used in any program that supports Unix domain sockets.
Add urls of filter lists (e.g. https://easylist.to/easylist/easylist.txt) to ~/.config/ars/urls
.
Custom rules (e.g. ###customAd) should be added to ~/.config/ars/lists/custom
.
After launching adblock-rust-server connect to /tmp/ars
socket file to start communicating.
Every request and response message have to end with a new line character \n
. Two request types are supported:
n <request_url> <source_url> <request_type>
For example:
n https://duckduckgo.com/p103.js https://duckduckgo.com/ script
Checks if the request should be blocked. Returns 1
if it should and 0
if not.
c <website_url> <ids> <classes>
For example:
c https://duckduckgo.com/ pg-index wedonttrack content_homepage logo_homepage_link
Returns a CSS rule that hides unwanted elements. <ids>
and <classes>
are lists of id/class names separated by the tab character \t
.
r
Restarts the adblock-rust engine applying any changes made to fiter lists or custom rules.
u
Updates every filter list and restarts the engine.