{"id":16236188,"url":"https://github.com/ganevdev/proxy-simple-test","last_synced_at":"2025-04-08T08:27:47.073Z","repository":{"id":57331882,"uuid":"170752297","full_name":"ganevdev/proxy-simple-test","owner":"ganevdev","description":"Simple proxy testing.","archived":false,"fork":false,"pushed_at":"2019-04-08T09:31:41.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T06:47:59.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/proxy-simple-test","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ganevdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-14T20:17:24.000Z","updated_at":"2020-11-11T14:52:45.000Z","dependencies_parsed_at":"2022-09-21T03:24:48.245Z","dependency_job_id":null,"html_url":"https://github.com/ganevdev/proxy-simple-test","commit_stats":null,"previous_names":["ganevru/proxy-simple-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganevdev%2Fproxy-simple-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganevdev%2Fproxy-simple-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganevdev%2Fproxy-simple-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganevdev%2Fproxy-simple-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ganevdev","download_url":"https://codeload.github.com/ganevdev/proxy-simple-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247803470,"owners_count":20998772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T13:29:33.397Z","updated_at":"2025-04-08T08:27:47.029Z","avatar_url":"https://github.com/ganevdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Proxy Simple Test\n\n[![Build Status](https://travis-ci.com/Ganevru/proxy-simple-test.svg?branch=master)](https://travis-ci.com/Ganevru/proxy-simple-test)\n[![npm](https://img.shields.io/npm/v/proxy-simple-test.svg?style=flat-square)](http://npm.im/proxy-simple-test)\n\nSimple proxy testing.\n\nAll work is done by [node-tunnel](https://github.com/koichik/node-tunnel) and [got](https://github.com/sindresorhus/got) - this is a great library that can do a lot, use it if you need more.\n\nIn order to make an object from a proxy string, I use my library - [split-proxy](https://github.com/Ganevru/split-proxy)\n\n`proxy-simple-test` - always returns `true` if test is passed or `false` if not.\n\nThe first argument is a proxy as a string or as an object (use what is convenient for you).\nThe second argument is the webpage to check.\n\nThe third argument is optional; it checks the body of the response to a specific text.\n\n`inBody` - if body of the answer has this text then the test is passed.\n\n`notInBody` - if body of the answer has this text then the test is NOT passed.\n\nIf third argument is a string, then it is automatically considered as `inBody`.\n\nThe test never passes if the response code is NOT `200`.\n\nIt is not necessary to use a proxy with `login` and `password`.\n\nAt the moment - only HTTP over HTTP tunneling.\n\n## Install\n\n```bash\nnpm i proxy-simple-test\n```\n\n## Examples\n\nProxy string:\n\n```js\nconst proxySimpleTest = require('proxy-simple-test');\n\n(async () =\u003e {\n  await proxySimpleTest(\n    '123.123.2.42:8080@superLogin:superPassword',\n    'www.example.com',\n    { inBody: '\u003ch1\u003eExample Domain\u003c/h1\u003e', notInBody: '\u003ch1\u003e404\u003c/h1\u003e' }\n  );\n})();\n\n// return true or false\n```\n\nThe third argument can be a string, then it will automatically be used as `inBody`.\n\n```js\nconst proxySimpleTest = require('proxy-simple-test');\n\n(async () =\u003e {\n  await proxySimpleTest(\n    '123.123.2.42:8080@superLogin:superPassword',\n    'www.example.com',\n    '\u003ch1\u003eExample Domain\u003c/h1\u003e'\n  );\n})();\n\n// return true or false\n```\n\nProxy string, without defining text from the body, in this case returns `true` if response code is `200`:\n\n```js\nconst proxySimpleTest = require('proxy-simple-test');\n\n(async () =\u003e {\n  await proxySimpleTest(\n    '123.123.2.42:8080@superLogin:superPassword',\n    'www.example.com'\n  );\n})();\n\n// return true or false\n```\n\nProxy object:\n\n```js\nconst proxySimpleTest = require('proxy-simple-test');\n\n(async () =\u003e {\n  await proxySimpleTest(\n    {\n      ipAddress: '123.123.2.42',\n      port: 8080,\n      login: 'superLogin',\n      password: 'superPassword'\n    },\n    'www.example.com',\n    { inBody: '\u003ch1\u003eExample Domain\u003c/h1\u003e', notInBody: '\u003ch1\u003e404\u003c/h1\u003e' }\n  );\n})();\n\n// return true or false\n```\n\nProxy object, another format, instead of `login` and `password`, you can write a `loginPass`, and instead of the `ipAddress` and `port` - `ipAddressPort`:\n\n```js\nconst proxySimpleTest = require('proxy-simple-test');\n\n(async () =\u003e {\n  await proxySimpleTest(\n    {\n      ipAddressPort: '123.123.2.42:8080',\n      loginPass: 'superLogin:superPassword'\n    },\n    'www.example.com',\n    { inBody: '\u003ch1\u003eExample Domain\u003c/h1\u003e', notInBody: '\u003ch1\u003e404\u003c/h1\u003e' }\n  );\n})();\n\n// return true or false\n```\n\nProxy object, another format:\n\n```js\nconst proxySimpleTest = require('proxy-simple-test');\n\n(async () =\u003e {\n  await proxySimpleTest(\n    {\n      ipAddress: '123.123.2.42',\n      port: 8080,\n      loginPass: 'superLogin:superPassword'\n    },\n    'www.example.com',\n    { inBody: '\u003ch1\u003eExample Domain\u003c/h1\u003e', notInBody: '\u003ch1\u003e404\u003c/h1\u003e' }\n  );\n})();\n\n// return true or false\n```\n\nOf course, you can use without a password and login:\n\n```js\nconst proxySimpleTest = require('proxy-simple-test');\n\n(async () =\u003e {\n  await proxySimpleTest(\n    {\n      ipAddress: '123.123.2.42',\n      port: 8080\n    },\n    'www.example.com',\n    { inBody: '\u003ch1\u003eExample Domain\u003c/h1\u003e', notInBody: '\u003ch1\u003e404\u003c/h1\u003e' }\n  );\n})();\n\n// return true or false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganevdev%2Fproxy-simple-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fganevdev%2Fproxy-simple-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganevdev%2Fproxy-simple-test/lists"}