Package Exports
- proxy-master
- proxy-master/package.json
Readme
Proxy Master
Node.JS proxy toolkit: Fetch, check, connect
📦 Installation
- Using
npmnpm i proxy-master - Using
Yarnyarn add proxy-master
- Using
pnpmpnpm add proxy-master
⚙️ Usage
import { fetchers, getAgent, isSocks } from "proxy-master";
const fetcher = fetchers.file({ path: "./proxy.txt" });
// fetch proxies initially
await fetcher.fetch();
fetcher.refetchOnInterval(3000);
// get random proxy
const proxy = fetcher.random();
// create custom agent
const agent = getAgent(proxy);
{
// fetch directly (node-fetch)
await fetch("https://example.com", { agent });
}
{
// create new vk
const vk = new VK({ agent });
}
{
// use in minecraft bot
// minecraft protocol is TCP based, to http proxies don't work
if (!isSocks(proxy)) {
return;
}
const bot = mineflayer.createBot({
stream: await createSocksSocket(proxy, "play.dicraft.net", 25565)
});
}