Proxy Simple Test
Simple proxy testing.
All work is done by node-tunnel and got - this is a great library that can do a lot, use it if you need more.
In order to make an object from a proxy string, I use my library - split-proxy
proxy-simple-test
- always returns true
if test is passed or false
if not.
The first argument is a proxy as a string or as an object (use what is convenient for you). The second argument is the webpage to check.
The third argument is optional; it checks the body of the response to a specific text.
inBody
- if body of the answer has this text then the test is passed.
notInBody
- if body of the answer has this text then the test is NOT passed.
If third argument is a string, then it is automatically considered as inBody
.
The test never passes if the response code is NOT 200
.
It is not necessary to use a proxy with login
and password
.
At the moment - only HTTP over HTTP tunneling.
Install
npm i proxy-simple-test
Examples
Proxy string:
const proxySimpleTest = ; async { await ;}; // return true or false
The third argument can be a string, then it will automatically be used as inBody
.
const proxySimpleTest = ; async { await ;}; // return true or false
Proxy string, without defining text from the body, in this case returns true
if response code is 200
:
const proxySimpleTest = ; async { await ;}; // return true or false
Proxy object:
const proxySimpleTest = ; async { await ;}; // return true or false
Proxy object, another format, instead of login
and password
, you can write a loginPass
, and instead of the ipAddress
and port
- ipAddressPort
:
const proxySimpleTest = ; async { await ;}; // return true or false
Proxy object, another format:
const proxySimpleTest = ; async { await ;}; // return true or false
Of course, you can use without a password and login:
const proxySimpleTest = ; async { await ;}; // return true or false