Skip to content

Recipe: banning certain domain

Snawoot edited this page Aug 10, 2025 · 1 revision

You can ban some domain from being accessed by users with a simple JS access script like this one:

function access(req, dst, username) {
	if (username == "ws" && dst.originalHost.match(/^(.*\.)?pikabu\.ru$/i)) {
		return false;
	}
	return true;
}

Warning

This rule will not help if user requests connection by IP address directly (e.g. Android proxy clients do that). However, additional rule blocking access by destination IP might help.

Specify this script file as -js-access-filter command line option or js-access-filter configuration file directive and you're good to go.

Clone this wiki locally