{"id":16236185,"url":"https://github.com/ganevdev/split-proxy","last_synced_at":"2025-04-08T08:28:31.729Z","repository":{"id":57367646,"uuid":"170048754","full_name":"ganevdev/split-proxy","owner":"ganevdev","description":"Split proxy string into Object: protocol, host, port, login and password.","archived":false,"fork":false,"pushed_at":"2023-12-23T21:25:35.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T21:01:54.368Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/split-proxy","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-11T01:29:17.000Z","updated_at":"2023-12-23T21:25:39.000Z","dependencies_parsed_at":"2024-10-22T00:42:52.821Z","dependency_job_id":null,"html_url":"https://github.com/ganevdev/split-proxy","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"ce3d2429cf72428797b5cb534d33d3286bbe4f35"},"previous_names":["ganevru/split-proxy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganevdev%2Fsplit-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganevdev%2Fsplit-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganevdev%2Fsplit-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganevdev%2Fsplit-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ganevdev","download_url":"https://codeload.github.com/ganevdev/split-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247803617,"owners_count":20998793,"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.307Z","updated_at":"2025-04-08T08:28:31.685Z","avatar_url":"https://github.com/ganevdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Split Proxy\n\n[![npm](https://img.shields.io/npm/v/split-proxy.svg?style=flat-square)](http://npm.im/split-proxy)\n\nSplit proxy string into object wish protocol, host, port, login and password.\n\n```bash\nnpm i split-proxy\n```\n\n## Examples\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('123.123.2.42:8080@superLogin:superPassword');\n\n// return this:\n// {\n//   protocol: '',\n//   host: '123.123.2.42',\n//   port: '8080',\n//   login: 'superLogin',\n//   password: 'superPassword'\n// }\n```\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('socks5://superLogin:superPassword@123.123.2.42:8080');\n\n// return this:\n// {\n//   protocol: 'socks5',\n//   host: '123.123.2.42',\n//   port: '8080',\n//   login: 'superLogin',\n//   password: 'superPassword'\n// }\n```\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('http://localhost:9005');\n\n// return this:\n// {\n//   protocol: 'http',\n//   host: 'localhost',\n//   port: '9005',\n//   login: '',\n//   password: ''\n// }\n```\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('https://www.example.com:9005');\n\n// return this:\n// {\n//   protocol: 'https',\n//   host: 'www.example.com',\n//   port: '9005',\n//   login: '',\n//   password: ''\n// }\n```\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('123.123.2.42');\n\n// return this:\n// {\n//   protocol: '',\n//   host: '123.123.2.42',\n//   port: '',\n//   login: '',\n//   password: ''\n// }\n```\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('http://123.123.2.42');\n\n// return this:\n// {\n//   protocol: 'http',\n//   host: '123.123.2.42',\n//   port: '',\n//   login: '',\n//   password: ''\n// }\n```\n\n## axios examples\n\n`{ mode: 'axios' }` special mode for use with library [axios](https://www.npmjs.com/package/axios) (with proxy config options) - it returns an object with the same names and formats as required by `axios`. It also never returns empty values.\n\nBy default `host: 'localhost'` and `port: 80`.\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('123.123.2.42:8080@superLogin:superPassword', { mode: 'axios' });\n\n// return this:\n// {\n//   host: '123.123.2.42',\n//   port: 8080,\n//   auth: {\n//     username: 'mikeymike',\n//     password: 'rapunz3l'\n//   }\n// }\n```\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('123.123.2.42:8080', { mode: 'axios' });\n\n// return this:\n// {\n//   host: '123.123.2.42',\n//   port: 8080\n// }\n```\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('localhost', { mode: 'axios' });\n\n// return this:\n// {\n//   host: 'localhost',\n//   port: 80\n// }\n```\n\n## node-tunnel examples\n\nMode for [node-tunnel](https://github.com/koichik/node-tunnel), returns an object with the same names and formats as required by `node-tunnel`. It also never returns empty values.\n\nBy default `host: 'localhost'` and `port: 80`.\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('123.123.2.42:8080@superLogin:superPassword', { mode: 'node-tunnel' });\n\n// return this:\n// {\n//   host: '123.123.2.42',\n//   port: 8080,\n//   proxyAuth: 'superLogin:superPassword'\n// }\n```\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('123.123.2.42:8080', { mode: 'node-tunnel' });\n\n// return this:\n// {\n//   host: '123.123.2.42',\n//   port: 8080\n// }\n```\n\n```js\nconst splitProxy = require('split-proxy');\nsplitProxy('localhost', { mode: 'node-tunnel' });\n\n// return this:\n// {\n//   host: 'localhost',\n//   port: 80\n// }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganevdev%2Fsplit-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fganevdev%2Fsplit-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganevdev%2Fsplit-proxy/lists"}