{"id":18010841,"url":"https://github.com/yokawasa/kubectl-plugin-socks5-proxy","last_synced_at":"2025-03-26T14:32:15.535Z","repository":{"id":44531921,"uuid":"328277357","full_name":"yokawasa/kubectl-plugin-socks5-proxy","owner":"yokawasa","description":"This is a kubectl plugin that creates a local SOCKS5 proxy through which you can access to pods/services in a Kubernetes cluster. Please [✩Star] if you're using it!","archived":false,"fork":false,"pushed_at":"2022-02-17T21:52:57.000Z","size":162,"stargazers_count":58,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T23:33:50.917Z","etag":null,"topics":["krew-plugin","kubectl","kubectl-plugins","kubernetes","socks5"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yokawasa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-01-10T01:03:12.000Z","updated_at":"2025-03-17T09:33:36.000Z","dependencies_parsed_at":"2022-08-27T21:43:25.967Z","dependency_job_id":null,"html_url":"https://github.com/yokawasa/kubectl-plugin-socks5-proxy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokawasa%2Fkubectl-plugin-socks5-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokawasa%2Fkubectl-plugin-socks5-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokawasa%2Fkubectl-plugin-socks5-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokawasa%2Fkubectl-plugin-socks5-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yokawasa","download_url":"https://codeload.github.com/yokawasa/kubectl-plugin-socks5-proxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245670897,"owners_count":20653447,"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":["krew-plugin","kubectl","kubectl-plugins","kubernetes","socks5"],"created_at":"2024-10-30T02:15:30.642Z","updated_at":"2025-03-26T14:32:15.222Z","avatar_url":"https://github.com/yokawasa.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kubectl-plugin-socks5-proxy\n\nThis is a kubectl plugin that creates a local SOCKS5 proxy through which you can access to Services or Pods in a Kubernetes cluster.\n\nWhat the plugin actually does is that it create a SOCKS proxy server Pod in a Kubernetes cluster and forwards a local port (default:1080) to the proxy. So you can access to Servcies or Pods in Kuberenetes cluster by using the local port as SOCKS5 proxy like this:\n\n```bash\ncurl --socks5-hostname localhost:1080 http://httpbin.default.svc.cluster.local/headers\n```\n\n## Installation\n\nThis is a way to install the plugin through [krew](https://krew.sigs.k8s.io/). After installing krew by following [this](https://krew.sigs.k8s.io/docs/user-guide/setup/install/), you can install the plugin like this:\n\n```\nkubectl krew install socks5-proxy\n```\n\nYou can search the plugin with a keyword like this:\n```\nkubectl krew search socks5\n\nNAME          DESCRIPTION                                      INSTALLED\nsocks5-proxy  SOCKS5 proxy to Services or Pods in the cluster  no\n```\n\nAfter installed the plugin, you can run the plugin like this:\n```\nkubectl socks5-proxy\n```\n\n## How to use\n\n### Usage\n\n```TXT\nUsage: \n  kubectl socks5-proxy\n\nOptions:\n  -n, --namespace \u003cnamespace\u003e   Namespace to create SOCKS5 proxy server in\n                                Default: default\n\n  -p, --port \u003clocal port\u003e       Local port to be forwarded to the SOCKS5 proxy server (Pod)\n                                A client connects to this port, then the connection is forwarded to the \n                                SOCKS5 proxy server, which is then forwareded to the destination server\n                                Default: 1080\n\n  -N --name \u003cpod name\u003e          Name to give the pod in the cluster\n                                Default: ${DEFAULT_NAME}\n\n  -i, --image \u003csocks5 image\u003e    Set the image used as socks5 proxy server\n                                Default: serjs/go-socks5-proxy\n\n  --skip-cleanup-proxy          Skip cearning up SOCKS5 proxy pod\n                                Default: Cleaning up SOCKS5 proxy pod at the end\n\n  -h, --help                    Show this message\n```\n\n### Deploy an sample app and Create SOCKS5 proxy\n\nSuppose you deploy a sample app in a Kubernetes cluster like this\n```bash\ngit clone https://github.com/yokawasa/kubectl-plugin-socks5-proxy.git\ncd kubectl-plugin-socks5-proxy\nkubectl apply -f sample-apps/party-clippy.yaml\n\nkubectl get svc\n\nNAME           TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE\nkubernetes     ClusterIP   10.0.0.1       \u003cnone\u003e        443/TCP   96d\nparty-clippy   ClusterIP   10.0.5.226     \u003cnone\u003e        80/TCP    1m\n```\n\nFirst of all, create a local SOCKS5 proxy (default: 1080 port) by running `kubectl socks5-proxy` like this:\n```\nkubectl socks5-proxy\n\nusing: namespace=default\nusing: port=1080\nCreating Socks5 Proxy (Pod)...\npod/socks5 created\nForwarding from 127.0.0.1:1080 -\u003e 1080\nForwarding from [::1]:1080 -\u003e 1080\n```\n\n### Use SOCKS5 Proxy in Curl\n\nNow you can access Srvices or Pods in the Kubernetes cluster from a local machine by using the local port as SOCKS proxy in Curl\n```\n# Service name\ncurl --socks5-hostname localhost:1080 party-clippy\n# Service name\ncurl --socks5-hostname localhost:1080 http://party-clippy\n# FQDN\ncurl --socks5-hostname localhost:1080 http://party-clippy.default.svc.cluster.local\n```\n\n```\n  _________________________________\n/ It looks like you're building a \\\n\\ microservice.                   /\n ---------------------------------\n \\\n  \\\n     __\n    /  \\\n    |  |\n    @  @\n    |  |\n    || |  /\n    || ||\n    |\\_/|\n    \\___/\n```\n\n### Use SOCKS5 Proxy in Google Chrome browser\n\nFirst, let's configuring your Chrome browser to use SOCKS5 proxy like this:\n\n**Linux**\n```\n/usr/bin/google-chrome \\\n    --user-data-dir=\"$HOME/proxy-profile\" \\\n    --proxy-server=\"socks5://localhost:1080\"\n```\n**macOS**\n```\n\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\" \\\n    --user-data-dir=\"$HOME/proxy-profile\" \\\n    --proxy-server=\"socks5://localhost:1080\"\n```\n**Windows**\n```\n\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" ^\n    --user-data-dir=\"%USERPROFILE%\\proxy-profile\" ^\n    --proxy-server=\"socks5://localhost:1080\"\n```\nSee also [How to Set up SSH SOCKS Tunnel for Private Browsing](https://linuxize.com/post/how-to-setup-ssh-socks-tunnel-for-private-browsing/)\n\n\u003e NOTE:\nThe --proxy-server=\"socks5://yourproxy:1080\" flag tells Chrome to send all http:// and https:// URL requests through the SOCKS proxy server \"yourproxy:1080\", using version 5 of the SOCKS protocol. The hostname for these URLs will be resolved by the proxy server, and not locally by Chrome.\n\u003e ref: [Configuring a SOCKS proxy server in Chrome](https://www.chromium.org/developers/design-documents/network-stack/socks-proxy)\n\nNow you are ready to access Services or Pods in the Kubernetes cluster with your Chrome browser\n\n![](assets/chrome-socks5-proxy.png)\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/yokawasa/kubectl-plugin-socks5-proxy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyokawasa%2Fkubectl-plugin-socks5-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyokawasa%2Fkubectl-plugin-socks5-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyokawasa%2Fkubectl-plugin-socks5-proxy/lists"}