Skip to content

Recipe: randomizing SNI used to communicate with upstream TLS proxy

Vladislav Yarmak edited this page Feb 2, 2026 · 1 revision

Dumbproxy also supports dynamic SNI spoofing. You can take some SNI whitelist (like this one and specify the following script in -js-proxy-router:

const sniList = readFile("whitelist.txt")
  .split(/\r?\n|\r|\n/g)
  .map(line => line.replace(/#.*$/, "").trim())
  .filter(line => line !== "");

const pick = arr => arr[Math.floor(Math.random() * arr.length)];

//print("loaded domains:");
//print(JSON.stringify(Array.from(sniList)));

function getProxy(req, dst, username) {
  const sni = pick(sniList);
  const proxyURL = `https://USERNAME:[email protected]:443?sni=${sni}`;
  print(`proxyURL = ${proxyURL}`);
  return proxyURL;
}

Clone this wiki locally