{"id":13775858,"url":"https://github.com/zjx20/socks-cli","last_synced_at":"2025-05-08T19:50:11.617Z","repository":{"id":76854138,"uuid":"75272212","full_name":"zjx20/socks-cli","owner":"zjx20","description":"A solution to make CLI commands use socks5 proxy.","archived":false,"fork":false,"pushed_at":"2024-07-24T15:00:48.000Z","size":114,"stargazers_count":53,"open_issues_count":0,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-31T17:55:23.125Z","etag":null,"topics":["curl","git","proxy","proxy-env","scp","socks5","ssh","terminal"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zjx20.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"supports/dsocks","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-01T08:35:33.000Z","updated_at":"2025-03-31T09:16:25.000Z","dependencies_parsed_at":"2024-01-07T22:47:17.010Z","dependency_job_id":"42449107-5565-41ce-81ea-7117c9241f84","html_url":"https://github.com/zjx20/socks-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjx20%2Fsocks-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjx20%2Fsocks-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjx20%2Fsocks-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zjx20%2Fsocks-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zjx20","download_url":"https://codeload.github.com/zjx20/socks-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253141187,"owners_count":21860534,"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":["curl","git","proxy","proxy-env","scp","socks5","ssh","terminal"],"created_at":"2024-08-03T17:01:52.708Z","updated_at":"2025-05-08T19:50:11.562Z","avatar_url":"https://github.com/zjx20.png","language":"Python","funding_links":[],"categories":["\u003ca id=\"d03d494700077f6a65092985c06bf8e8\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"57b8e953d394bbed52df2a6976d98dfa\"\u003e\u003c/a\u003eSocks"],"readme":"socks-cli\n=========\n\n`socks-cli` is a solution to make CLI commands use the specified socks5 proxy, by setting up special environment variables, such as `ALL_PROXY`. It works on linux and macOS with bash and python installed.\n\nHere is an incomplete list of supported commands:\n\n* git\n* curl\n* wget\n* brew\n* pod\n* gem\n* npm\n* mvn\n* ssh\n* scp\n* ...\n\n## Usage\n\n1. Clone the code.\n\t```bash\n\tgit clone https://github.com/zjx20/socks-cli.git\n\t```\n\n2. Copy `socksproxyenv.sample` to `socksproxyenv`, and fill your socks5 server into it.\n\t```bash\n\tcd socks-cli\n\tcp socksproxyenv.sample socksproxyenv\n\n\t# edit socksproxyenv, complete the line:\n\t#   export SOCKS_PROXY=\n\t```\n\n3. Invoke `source socks-cli/activate` before running your CLI commands:\n\t```bash\n\t$ source socks-cli/activate\n\tServing HTTP proxy on 127.0.0.1 port 54967 ...\n\tDone! Variables or aliases have been changed to:\n\t  GIT_PROXY_COMMAND=/Users/x/socks-git/sh/socksified-connect.sh\n\t  GIT_SSH=/Users/x/socks-git/sh/socksified-ssh.sh\n\t  ALL_PROXY=socks5h://127.0.0.1:1080\n\t  HTTP_PROXY=http://127.0.0.1:54967\n\t  HTTPS_PROXY=http://127.0.0.1:54967\n\n\t# Following commands will use the socks proxy!\n\n\t$ git clone git@github.com:git/git.git\n\tCloning into 'git'...\n\tremote: Counting objects: 213208, done.\n\tremote: Compressing objects: 100% (372/372), done.\n\tReceiving objects 2.0% (1/213208), 620.00 KiB | 121.00 KiB/s\n\t...\n\n\t# Check your external IP!\n\t$ curl ipinfo.io\n\t...\n\t```\n\n4. Optionally, you can invoke `source socks-cli/deactivate` to deactivate `socks-cli`.\n\nFor more details, please see [socksproxyenv.sample](socksproxyenv.sample).\n\n### One-Shot Mode\n\nThe usage described above affects all commands in the terminal session. If you wish to temporarily enable the socks proxy for only a particular command, you can use the `socksify` script. (Note: You still need to configure the `socksproxyenv` file first.)\n\n```bash\n# make a symlink to PATH\nln -s /path/to/socks-cli/socksify /usr/local/bin/socksify\n\n# or make an alias\nalias socksify='/path/to/socks-cli/socksify'\n\n# enable for one-shot\nsocksify curl ipinfo.io\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzjx20%2Fsocks-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzjx20%2Fsocks-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzjx20%2Fsocks-cli/lists"}