Fast proxy tester
NodeJS module for verifying the speed, quality, transparency and functionality of a proxy.
Socks4/Socks5/Http/Https proxy support
Can check transparency (Elite/Transparent), location, end IP address, etc.
Example of supported proxies:
socks5://user:password@ip:port
socks4://ip:port:user:password
http://ip:port
https://ip:port
All protocols support user and password authorization
except socks4, which only supports user authorization
Setting it up
import createProxyTester from "fast-proxy-tester"
const createProxyTester = require("fast-proxy-tester").createProxyTester
let tester = createProxyTester("http://proxy:port", 30000)
functions:
* testPrivacy()
tells you if the proxy is transparent or not, and its location and ip.
await tester.testPrivacy().then((privacy) => {
console.log(privacy.privacy)
console.log(privacy.ip)
console.log(privacy.geo)
}).catch((error) => {
console.log(err)
})
* testProxyURL(proxy_url)
proxy_url - url of the proxy
Checks if the proxy is formatted correctly
If it is then it isValid is true and it parses the proxy
If not then isValid is false and err is set to the error
let isValidProxy = tester.testProxyURL(proxy_url)
if(isValidProxy.isValid){
console.log(isValidProxy.protocol)
console.log(isValidProxy.proxy_url)
console.log(isValidProxy.proxy_port)
if(isValidProxy.username){
console.log(isValidProxy.username)
console.log(isValidProxy.password)
}
} else {
console.log(isValidProxy.err)
}
console.log(privacy.privacy)
console.log(privacy.ip)
console.log(privacy.geo)
* fastTest(url)
url - the url of the page to test
Note: If the proxy format is invalid it will reject with a testProxyURL() error
Makes a quick request using axios and lets you check
the headers, the status, the data and the latency.
await tester.fastTest(url).then((result) => {
console.log(result.status)
console.log(result.headers)
console.log(result.latency)
console.log(result.data)
}).catch((error) => {
if(error == "timeout"){
console.log("Proxy speed too small")
} else {
console.log(result.status)
console.log(result.headers)
console.log(result.latency)
console.log(result.data)
}
})
- test(url, browser)
url - the url of the page to test
browser - a browser launched by puppeteer
Note: If the proxy format is invalid it will reject with a testProxyURL() error
Makes a quick request using axios and lets you check
the headers, the status, the data and the latency.
await tester.test(url, chromePath, puppeteer).then((result) => {
console.log(result.status)
console.log(result.headers)
console.log(result.latency)
console.log(result.data)
}).catch((error) => {
console.log(error)
})