npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

proxy-list-checker

v0.4.0

Published

A Node.js module to check the validity of proxies on various websites.

Downloads

15

Readme

Proxy List Checker - NodeJS

npm version license

A module to check the validity of proxies on various websites.

Description

Proxy List Checker is a Node.js module that allows you to validate the availability and functionality of proxies by checking their ability to connect to different websites. It supports HTTP and HTTPS proxy protocols and provides detailed results on the connectivity and performance of each proxy. This tool is essential for maintaining a reliable list of working proxies for tasks such as web scraping, automation, and accessing geo-restricted content.

Installation

You can install this module via npm:

npm install proxy-list-checker

Dependencies

This project uses the following dependencies:

  • Node.js: >= 20.11.1
  • axios: ^1.7.3
  • http-proxy-agent: ^7.0.2
  • https-proxy-agent: ^7.0.5
  • jest: (dev dependency): ^29.7.0
  • jsdoc: (dev dependency): ^4.0.3

Usage

Manually creating variables

// Single proxy and site
async function example() {
    const proxy = new Proxy('1.1.1.1', 8080);
    
    const site = new Site('https://example.com', 5000);
    
    await checkProxies(site, proxy);
    
    printWorkingProxies(site);
}

// Multiple proxies and sites
async function example() {
    const proxies = [
        new Proxy('1.1.1.1', 8080),
        new Proxy('2.2.2.2')
    ];
    
    const sites = [
        new Site('https://example.com', 5000),
        new Site('https://anotherexample.com')
    ];
    
    await checkProxies(sites, proxys);

    printWorkingProxies(site);
}

Reading and saving variables from a file

// Single proxy and site
async function example() {
    const proxy = await readProxiesFromFile('inputProxyFile.txt');
    
    const site = await readSitesFromFile('inputSiteFile.txt');
    
    await checkProxiesAndSave(site, proxy);
}

// Multiple proxies and sites
async function example() {
    const proxies = await readProxiesFromFile('inputProxyFile.txt');

    const sites = await readSitesFromFile('inputSiteFile.txt');

    await checkProxiesAndSave(sites, proxies);
}

Methods

readProxiesFromFile(filePath)

Reads proxies from a file.

Parameters:

  • filePath (string) - The path to the file containing proxies.

Returns:

  • Promise<Proxy[]> - A promise that resolves to an array of Proxy instances.

Notes:

  • The input file should follow the format ip:port:username:password.
  • Each line represents a proxy with its ip and port, while the username and password are optional.

readSitesFromFile(filePath)

Reads sites from a file.

Parameters:

  • filePath (string) - The path to the file containing sites.

Returns:

  • Promise<Site[]> - A promise that resolves to an array of Site instances.

Note:

  • The input file should follow the format url tiemout.
  • Each line represents a site with its url, while the timeout (in ms) is optional.

printWorkingProxies(site)

Prints working proxies of a site to the console.

Parameters:

  • site (Site) - The site whose list of proxies we want to display is valid.

Returns:

  • void - This function does not return a value. It prints the proxies to the console.

checkProxiesAndSave

Verify the validity of the proxy list on the site list and register the results in the files.

Parameters:

  • sites (Site | Site[]) - The site or list of sites to check.
  • proxies (Proxy | Proxy[]) - The proxy or list of proxies to check.

Returns:

  • Promise<void> - A promise that resolves when all proxies have been checked.

Notes:

  • This function will create a working proxies folder in which it will create an all_site.txt file to store the proxies valid on all sites, as well as a file per site containing the list of proxies valid on that site.

checkProxies

Verify the validity of the proxy list on the site list.

Parameters:

  • sites (Site | Site[]) - The site or list of sites to check.
  • proxies (Proxy | Proxy[]) - The proxy or list of proxies to check.

Returns:

  • Promise<void> - A promise that resolves when all proxies have been checked.

Note:

  • This function will only check the validity of the proxies without displaying or saving anything, valid proxies
  • will be stored in the workingProxies array of each site.

Scripts

test

npm test

docs

npm run docs

example

npm run example

License

This project is licensed under the MIT License. See the LICENSE file for details.