v2.0.0
New Features
add support for proxy Node 18+ builtin fetch with PAC, example:
import { readFileSync } from "fs";
import { PACDispatcher } from "pac-maker";
// Only needed if your Node < 18.1.0
// import { fetch } from "undici";
const pac = readFileSync("proxy.pac", "utf8");
const dispatcher = new PACDispatcher(pac);
const response = await fetch("https://example.com", { dispatcher });Also add dispatcher parameter to builtin hostname sources which need fetch data from network.
import { readFileSync } from "fs";
import { gfwlist, PACDispatcher } from "pac-maker";
const pac = readFileSync("proxy.pac", "utf8");
const dispatcher = new PACDispatcher(pac);
const source = gfwlist({ dispatcher });