{"_rev":"4-20ad15cdf76d100b86a77da07fa4d5d1","time":{"created":"2022-09-24T04:55:02.381Z","1.0.0":"2022-09-22T05:22:18.391Z","modified":"2022-09-24T04:55:02.780Z","1.0.1":"2022-09-24T04:55:02.650Z"},"_id":"5socks","name":"5socks","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"$schema":"https://json.schemastore.org/package","name":"5socks","version":"1.0.1","description":"A tiny utility to make working with 5socks less painful.","keywords":["5socks","socks","socks5","proxy","cli","helper"],"homepage":"https://github.com/nicoandmee/5socks","bugs":{"url":"https://github.com/nicoandmee/5socks/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/nicoandmee/5socks.git"},"license":"MIT","author":{"name":"Nico","email":"nicomee@riseup.net","url":"https://nicomee.com/"},"type":"module","main":"dist/index.js","bin":{"5socks":"dist/index.js"},"scripts":{"prebuild":"run-s clean","build":"run-s build:*","build:clean":"run-s clean","build:tsc":"tsc","clean":"rimraf dist","lint":"run-p lint:*","lint:eslint":"eslint src --ext .ts --fix","lint:sort":"sort-package-json","upgrade":"ncu -u --packageFile package.json"},"dependencies":{"arg":"^5.0.2","chalk":"^5.0.1","clipboardy":"^3.0.0","debug":"^4.3.4","got":"^12.5.0","playwright":"^1.25.2","playwright-extra":"^4.3.5","puppeteer-extra-plugin-stealth":"^2.11.1","socks-proxy-agent":"^7.0.0","tslib":"^2.4.0","tslog":"^3.3.4"},"devDependencies":{"@nodesuite/eslint-config":"^0.1.13","@rushstack/eslint-config":"^3.0.1","@types/debug":"^4.1.7","@types/node":"^18.7.18","@typescript-eslint/parser":"^5.37.0","esbuild":"^0.15.7","esbuild-register":"^3.3.3","eslint":"8.22.0","npm-check-updates":"^15.3.4","npm-run-all":"^4.1.5","prettier-config-standard":"^5.0.0","sort-package-json":"^1.57.0","tsup":"^6.2.3","typescript":"4.7.4"},"engines":{"node":">=16"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"gitHead":"c33627eb38fa0e2293ceba8669c6e8b5376f77de","_id":"5socks@1.0.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-o7+sn8jXhbGwl2I987MGZcXU2GqOLx/lEwImzlS8g3F7IOUCCX9kRo8g10CH5qALlR0ElowMmIKo5tkAe6O48Q==","shasum":"ce4ea4d7e24ca9fafaf85457fc18abe367d032b8","tarball":"https://registry.npmjs.org/5socks/-/5socks-1.0.1.tgz","fileCount":10,"unpackedSize":24726,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA5cMEmmkqe7e529Q4jRsfQ9StAK+gR+h7JjTCfkEb0cAiEA+f2j4nwkY8QhhDjX/XlWi+qyAZPuYYZjL5AXSbFgrvA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLo2mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaiRAAhmqUUymrOrpFcZCDIFR/SxkU9huUJNX3vapP0jMNBUDqP16B\r\nqr/yrIS5iy81+PJLZtZptuDDbowfBYD1xlcnDx460CtDKLkTsOLCq3WtLYnm\r\n2mrYS05wz6/P7NJRWZMDoBcnYhHq0t7xnQMCFRZXK6+CWpl1FDV6/lqNYoyA\r\n8aweKSwYEdO7PslSGCGF98cpeGVuMf6Z3Cd4SQ/IGcPFXrtSRy5LsRpJJao5\r\nHlGBagO91urg4Hm25yFdBZQ9aJ6AKO9+05jyaLOTMYTDouvzHa+tUGemAilC\r\nG0NYSHeMv3+GJq8Xo9vyseWz69kTQs15csHFj9USKoiWe6nvyWD+4uTLqJZs\r\nR1z//WZVW/8n0vzsnbUbetnI23KhcVYtjvcbuHdzNjS3zti2e5cDV+jk2Uli\r\n59IkXYAAQM+5OCQKIiF9h0t8gmjuvMFzYyyAYcQsPfHhOHfLHawkRyDBmb3N\r\nnXkQRl2jGVpNT99GAaW0JM2F6L9p5rChtl8zntBrFdbFHRXcO/+QJmMwOLWo\r\n5507VGTodWiSC4V+hNDlxim6c9bJ3XJxhmiqTUnI7l216tmgGUKpvgabViVN\r\nIkp2nrv+sfLmweBt5QIMtfG+dkYQ5ebo4AQhY7RhpToCAiGtuKVGWPS/ji46\r\ni83aSKNC8Z/FD7O0YcOKCETsz1tXHJO67Mg=\r\n=afoL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nicomee","email":"nico@nicomee.com"},"directories":{},"maintainers":[{"name":"nicomee","email":"nico@nicomee.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/5socks_1.0.1_1663995302450_0.698503054293393"},"_hasShrinkwrap":false}},"maintainers":[{"name":"nicomee","email":"nico@nicomee.com"}],"description":"A tiny utility to make working with 5socks less painful.","homepage":"https://github.com/nicoandmee/5socks","keywords":["5socks","socks","socks5","proxy","cli","helper"],"repository":{"type":"git","url":"git+ssh://git@github.com/nicoandmee/5socks.git"},"author":{"name":"Nico","email":"nicomee@riseup.net","url":"https://nicomee.com/"},"bugs":{"url":"https://github.com/nicoandmee/5socks/issues"},"license":"MIT","readme":"<p align=\"center\">\r\n  <a href=\"\" rel=\"noopener\">\r\n <img src=\"https://5socks.net/img/screenshot.png\" alt=\"5socks\"></a>\r\n</p>\r\n<h3 align=\"center\">5socks</h3>\r\n\r\n<div align=\"center\">\r\n\r\n[![Status](https://img.shields.io/badge/status-active-success.svg)]()\r\n[![GitHub Issues](https://img.shields.io/github/issues/kylelobo/The-Documentation-Compendium.svg)](https://github.com/kylelobo/The-Documentation-Compendium/issues)\r\n[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/kylelobo/The-Documentation-Compendium.svg)](https://github.com/kylelobo/The-Documentation-Compendium/pulls)\r\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)\r\n\r\n</div>\r\n\r\n---\r\n\r\n<p align=\"center\"> A tiny CLI utility to make working with the wonderful 5SOCKS service less painful, and more productive.\r\n    <br>\r\nКрошечная утилита CLI, которая сделает работу с сервисом 5SOCKS менее болезненной и более продуктивной.\r\n</p>\r\n\r\n## 📝 Table of Contents\r\n\r\n- [📝 Table of Contents](#-table-of-contents)\r\n- [☭ A Call To Action <a name = \"idea\"></a>](#-a-call-to-action-)\r\n- [🚀Install & Configuration <a name = \"install\"></a>](#install--configuration-)\r\n  - [Prerequisites](#prerequisites)\r\n- [🎈 Usage <a name=\"usage\"></a>](#-usage-)\r\n- [⛏️ Built With <a name = \"tech_stack\"></a>](#️-built-with-)\r\n- [🎉 🙏 Acknowledgments <a name = \"acknowledgments\"></a>](#--acknowledgments-)\r\n\r\n## ☭ A Call To Action <a name = \"idea\"></a>\r\n\r\nComrades, who among you can say to have enjoyed the use of [5socks.net](https://5socks.net/en/)? Although the quality of material is high, the website never left the 1990s if we're being honest. As there is no API for users to manage proxies with, I became very frustrated and spent a couple of hours writing this utility.\r\n\r\nDuring this time I noticed 5socks.net appears to have embedded code to detect other more, ah, unsophisticated automation tools at work (webdriver-based tools, to be frank, sorry). I will leave the analysis of the offending code fragment as a homework assignment in the bottom of the `README.md`.\r\n\r\n## 🚀Install & Configuration <a name = \"install\"></a>\r\n\r\nHow to use the tool? It is very simple. First we must make the installation using our favorite package manager:\r\n\r\n```sh\r\nnpm i -g 5socks\r\nyarn global add 5socks\r\n```\r\n\r\nThen, we must export the credentials of the 5socks account we wish to use as environment variables. However, be careful, comrades! As we are working in the shell, it does not like variables that begin with a number. It shares this quality with our friend javascript. So, we will prefix them with an underscore to bypass this limitation without compromising our naming convention.\r\n\r\n```sh\r\nexport _5SOCKS_USER='wombat'\r\nexport _5SOCKS_PASSWORD='lenin'\r\nexport DEBUG='5socks' # this is optional, but may be needed to troubleshoot issues\r\n```\r\n\r\nNow we are ready to begin work. The binary takes two positional parameters:\r\n\r\n- Country: This is a two-character ISO Alpha-2 code.\r\nExamples: `['US', 'RU', 'SY']`\r\n\r\n- State/Region: **Optional** parameter, again a two-character ISO region code.\r\nExamples: `['CA', 'NY', 'FL']`\r\n\r\nThe tool currently supports a single `--headful or -h` option: this launches chromium in plain view, instead of headless (the default). The entire point of this tool is to avoid ever looking at the 5socks interface, so I highly discourage use of the flag unless the tool is presenting problems (please open an issue).\r\n\r\n### Prerequisites\r\n\r\nTo ensure [playwright](https://playwright.dev) has what it needs to launch chromium and perform the automated flow, please run the following in a shell:\r\n\r\n```sh\r\nnpx playwright install-deps chrome\r\n```\r\n\r\nThis will install the neccesary system dependencies that chromium requires. Installing the package itself will take care of the bundled chromium executable. Additionally, make sure that your `node` is >= 16, at least for this project. I personally recommend [https://github.com/Schniz/fnm](https://github.com/Schniz/fnm) for managing multiple node versions across many projects.\r\n\r\nIf you choose to use it, note that the presence of the `.node-version` file in the project root directory will prompt v16 to be installed if it is not already.\r\n\r\n## 🎈 Usage <a name=\"usage\"></a>\r\n\r\nHere are some example invocations of the binary:\r\n\r\n```sh\r\n5socks ru # Fetch a SOCKS5 proxy within the Russian Federation\r\n5socks us ca # Fetch a SOCKS5 proxy in California, USA\r\n5socks us -h # Fetch a USA proxy, launching browser in headful mode for debugging\r\n```\r\n\r\nA detailed ip lookup fingerprint will be presented once the proxy has been acquired:\r\n\r\n```json\r\n{\r\n  \"ip\": \"82.147.116.195\",\r\n  \"country\": \"RU\",\r\n  \"asn\": {\r\n    \"asnum\": 12772,\r\n    \"org_name\": \"JSC ER-Telecom Holding\"\r\n  },\r\n  \"geo\": {\r\n    \"city\": \"\",\r\n    \"region\": \"\",\r\n    \"region_name\": \"\",\r\n    \"postal_code\": \"\",\r\n    \"latitude\": 55.7386,\r\n    \"longitude\": 37.6068,\r\n    \"tz\": \"Europe/Moscow\"\r\n  },\r\n  \"method\": \"GET\",\r\n  \"httpVersion\": \"1.1\",\r\n  \"url\": \"/echo.json\",\r\n  \"headers\": {\r\n    \"Host\": \"lumtest.com\",\r\n    \"X-Real-IP\": \"82.147.116.195\",\r\n    \"X-Forwarded-For\": \"82.147.116.195\",\r\n    \"X-Forwarded-Proto\": \"https\",\r\n    \"X-Forwarded-Host\": \"lumtest.com\",\r\n    \"user-agent\": \"got (https://github.com/sindresorhus/got)\",\r\n    \"accept\": \"application/json\",\r\n    \"accept-encoding\": \"gzip, deflate, br\"\r\n  }\r\n}\r\n```\r\n\r\nThe proxy will also be copied to the clipboard, allowing you to go straight ahead seamlessly with your work.\r\n\r\n## ⛏️ Built With <a name = \"tech_stack\"></a>\r\n\r\n- [Playwright](https://playwright.dev/) - Cross-browser automation and testing framework\r\n- [nodesuite](https://github.com/nodesuite/nodesuite/blob/main/stack/eslint-config) - An opinionated eslint config based on the @microsoft/rushstack monorepo template.\r\n- [playwright-extra](https://github.com/berstend/puppeteer-extra/tree/master/packages/playwright-extra) - A modular plugin framework for playwright to enable cool plugins through a clean interface\r\n- [Typescript](https://www.typescriptlang.org//) - JS with less errors\r\n\r\n## 🎉 🙏 Acknowledgments <a name = \"acknowledgments\"></a>\r\n\r\n- <https://github.com/prescience-data>\r\n- <https://github.com/berstend>\r\n\r\nHere is the interesting script I found embedded on 5SOCKS (note: my username has, for obvious reasons, been removed.)\r\n\r\n```js\r\nrBD = function () {\r\n    var e = [\"__webdriver_evaluate\", \"__selenium_evaluate\", \"__webdriver_script_function\", \"__webdriver_script_func\", \"__webdriver_script_fn\", \"__fxdriver_evaluate\", \"__driver_unwrapped\", \"__webdriver_unwrapped\", \"__driver_evaluate\", \"__selenium_unwrapped\", \"__fxdriver_unwrapped\"],\r\n        n = [\"_phantom\", \"__nightmare\", \"_selenium\", \"callPhantom\", \"callSelenium\", \"_Selenium_IDE_Recorder\"];\r\n    for (windowDetectionKey in n)\r\n        if (windowDetectionKeyValue = n[windowDetectionKey], window[windowDetectionKeyValue]) return !0;\r\n    for (documentDetectionKey in e)\r\n        if (documentDetectionKeyValue = e[documentDetectionKey], window.document[documentDetectionKeyValue]) return !0;\r\n    for (documentKey in window.document)\r\n        if (documentKey.match(/$[a-z]dc_/) && window.document[documentKey].cache_) return !0;\r\n    try {\r\n        if (window.external && window.external.toString() && -1 != window.external.toString().indexOf(\"Sequentum\")) return !0\r\n    } catch (e) {}\r\n    return !!window.document.documentElement.getAttribute(\"selenium\") || (!!window.document.documentElement.getAttribute(\"webdriver\") || (!!window.document.documentElement.getAttribute(\"driver\") || (1 == navigator.webdriver || !(!window.callPhantom && !window._phantom))))\r\n};\r\nif (rBD() == true) {\r\n    try {\r\n        hr = encodeURIComponent(window.document.location.href);\r\n        an = encodeURIComponent(navigator.appName);\r\n        av = encodeURIComponent(navigator.appVersion);\r\n        res = window.screen.width + 'x' + window.screen.height;\r\n        ua = encodeURIComponent(navigator.userAgent);\r\n    } catch (e) {\r\n        hr = 'error';\r\n    };\r\n    document.write('<img src=\"' + 'http://anyproxy.net/' + 'chkimg' + '.php' + '?u=' + 'comradeNapoleon' + '&ib=100' + '&hr=' + hr + '&an=' + an + '&av=' + av + '&res=' + res + '&ua=' + ua + '\" width=1 height=1>');\r\n}\r\n```\r\n","readmeFilename":"README.md"}