Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
free-proxy
Advanced tools
Readme
Fetch free proxies from https://www.free-proxy-list.com
Item | Details |
---|---|
System | GNU/Linux (>=2.6.x), macOS (>=10.10.x), Windows (later than XP) |
Environment | Node.js >= 8.2.0 |
# under product mode
$ npm install free-proxy --save
$ yarn add free-proxy
# under development mode
$ npm install free-proxy --save-dev
$ yarn add -D free-proxy
After you finished the installation above, you will have a package free-proxy
in your ./node_modules
directory.
Default module exports in CommonJS style
const ProxyList = require('free-proxy');
const proxyList = new ProxyList();
or
import ProxyList from 'free-proxy';
const proxyList = new ProxyList();
Get proxy list. This function will craw the website and returns an array of proxy list, and some information (e.g. IP address, port, country, etc.) wrapped in a Promise object.
Recommended usage:
let proxies;
try {
proxies = await proxyList.get();
} catch (error) {
throw new Error(error);
}
or alternatively:
proxyList.get()
.then(function (proxies) {
// get proxies here
})
.catch(function (error) {
throw new Error(error);
});
Get list of proxies using a specific protocol. This function will use proxyList.get
and filter the result by protocaol
Recommended usage:
let proxies;
try {
proxies = await proxyList.getByProtocol('https');
} catch (error) {
throw new Error(error);
}
or alternatively:
proxyList.getByProtocol('http')
.then(function (proxies) {
// get proxies here
})
.catch(function (error) {
throw new Error(error);
});
Get proxy list from a specific country. This function will use proxyList.get
and filter the result by countryCode
Recommended usage:
let proxies;
try {
proxies = await proxyList.getByCountryCode('FR');
} catch (error) {
throw new Error(error);
}
or alternatively:
proxyList.getByCountryCode('FR')
.then(function (proxies) {
// get proxies here
})
.catch(function (error) {
throw new Error(error);
});
Get a proxy randomly. Based on proxyList.get()
, this function will get a random item from the results of proxyList.get()
Recommended usage:
let data;
try {
data = await proxyList.random();
} catch (error) {
throw new Error(error);
}
or alternatively:
proxyList.random()
.then(function (data) {
// get data here
})
.catch(function (error) {
throw new Error(error);
});
Get a proxy randomly. Based on proxyList.getByProtocol()
, this function will get a random item from the results of proxyList.get()
Recommended usage:
let data;
try {
data = await proxyList.randomByProtocol('https');
} catch (error) {
throw new Error(error);
}
or alternatively:
proxyList.randomByProtocol('http')
.then(function (data) {
// get data here
})
.catch(function (error) {
throw new Error(error);
});
Get a proxy randomly. Based on proxyList.getByCountryCode()
, this function will get a random item from the results of proxyList.get()
Recommended usage:
let data;
try {
data = await proxyList.randomByCountryCode('FR');
} catch (error) {
throw new Error(error);
}
or alternatively:
proxyList.randomByCountryCode('FR')
.then(function (data) {
// get data here
})
.catch(function (error) {
throw new Error(error);
});
Get a proxy randomly. Based on proxyList.get()
, this function will get a random item from the results of proxyList.get()
. The list is cached the first time the method is invoked and only updated once the cached list runs out of proxies.
Recommended usage:
let data;
try {
data = await proxyList.randomFromCache();
} catch (error) {
throw new Error(error);
}
or alternatively:
proxyList.randomFromCache()
.then(function (data) {
// get data here
})
.catch(function (error) {
throw new Error(error);
});
To run the test suite, go to the root directory of this package, and install dependencies, and then run npm test
or npm run test
:
$ cd /path/to/free-proxy
$ npm install
$ npm test
# or
$ npm run test
FAQs
Fetch free proxies from https://www.free-proxy-list.com
The npm package free-proxy receives a total of 154 weekly downloads. As such, free-proxy popularity was classified as not popular.
We found that free-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.