JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q37178F
  • License MIT

🌐 Proxy toolkit: parse, check, fetch from services

Package Exports

  • proxy-master
  • proxy-master/package.json

Readme

Proxy Master

Node.JS proxy toolkit: Fetch, check, connect

Test Status Downloads last commit codecov GitHub proxy-master Known Vulnerabilities Quality npm license MIT Size

📦 Installation

  • Using npm
    npm i proxy-master
  • Using Yarn
    yarn add proxy-master
  • Using pnpm
    pnpm 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)
  });
}