{"id":26675590,"url":"https://github.com/linkdata/socks5","last_synced_at":"2025-03-26T03:18:48.905Z","repository":{"id":278389741,"uuid":"935426767","full_name":"linkdata/socks5","owner":"linkdata","description":"SOCKS5 server and client","archived":false,"fork":false,"pushed_at":"2025-03-17T07:25:48.000Z","size":129,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T08:33:18.302Z","etag":null,"topics":["associate","bind","connect","go","golang","proxy-server","socks5","socks5-client","socks5-server","socks5h","tcp-proxy","udp-proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","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/linkdata.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":"2025-02-19T12:30:50.000Z","updated_at":"2025-03-17T07:25:12.000Z","dependencies_parsed_at":"2025-03-06T10:30:23.352Z","dependency_job_id":"f76adde9-4fff-43da-a8bb-1991a2bbb266","html_url":"https://github.com/linkdata/socks5","commit_stats":null,"previous_names":["linkdata/socks5"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fsocks5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fsocks5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fsocks5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdata%2Fsocks5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkdata","download_url":"https://codeload.github.com/linkdata/socks5/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245579675,"owners_count":20638679,"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":["associate","bind","connect","go","golang","proxy-server","socks5","socks5-client","socks5-server","socks5h","tcp-proxy","udp-proxy"],"created_at":"2025-03-26T03:18:48.478Z","updated_at":"2025-03-26T03:18:48.892Z","avatar_url":"https://github.com/linkdata.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build](https://github.com/linkdata/socks5/actions/workflows/build.yml/badge.svg)](https://github.com/linkdata/socks5/actions/workflows/build.yml)\n[![coverage](https://coveralls.io/repos/github/linkdata/socks5/badge.svg?branch=main)](https://coveralls.io/github/linkdata/socks5?branch=main)\n[![goreport](https://goreportcard.com/badge/github.com/linkdata/socks5)](https://goreportcard.com/report/github.com/linkdata/socks5)\n[![Docs](https://godoc.org/github.com/linkdata/socks5?status.svg)](https://godoc.org/github.com/linkdata/socks5)\n\n# socks5\n\nSOCKS5 client and server. Full test coverage provided by https://github.com/linkdata/socks5test.\n\n- Support for the CONNECT command\n- Support for the BIND command\n- Support for the ASSOCIATE command\n- Uses ContextDialer's for easy interoperation with other packages\n- Only depends on the standard library\n\n## Client\n\nThe client support for `net.Listener` includes reporting the bound address and port before calling `Accept()` and\nsupports multiple concurrent `Accept()` calls, allowing you to reverse-proxy a server using this package.\n\n## Server\n\nThe server can listen on multiple listeners concurrently.\n\nThe server provides two abstractions to customize it's behavior.\n\nThe `Authenticator` interface allows custom authentication methods, and comes with implementations for\nanonymous usage (`NoAuthAuthenticator`) or username/password authentication (`UserPassAuthenticator`).\n\nThe `DialerSelector` interface allows selecting the `ContextDialer` to use for each outgoing connection\nbased on authentication method, username, network and address. The default uses `socks5.DefaultDialer`.\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"log/slog\"\n\t\"net\"\n\t\"time\"\n\n\t\"github.com/linkdata/socks5/client\"\n\t\"github.com/linkdata/socks5/server\"\n)\n\nfunc main() {\n\tctx, cancel := context.WithTimeout(context.Background(), time.Second/10)\n\tdefer cancel()\n\n\tlistener, err := net.Listen(\"tcp\", \":0\")\n\tif err == nil {\n\t\tdefer listener.Close()\n\t\tsrv := server.Server{\n\t\t\tLogger: slog.Default(),\n\t\t\tAuthenticators: []server.Authenticator{\n\t\t\t\tserver.NoAuthAuthenticator{},\n\t\t\t\tserver.UserPassAuthenticator{\n\t\t\t\t\tCredentials: server.StaticCredentials{\n\t\t\t\t\t\t\"joe\": \"123456\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\tgo srv.Serve(ctx, listener)\n\t\tvar cli *client.Client\n\t\tif cli, err = client.New(\"socks5h://joe:123456@\" + listener.Addr().String()); err == nil {\n\t\t\tvar l net.Listener\n\t\t\tif l, err = cli.ListenContext(ctx, \"tcp\", \":0\"); err == nil {\n\t\t\t\tdefer l.Close()\n\t\t\t\tslog.Info(\"client BIND\", \"address\", l.Addr().String())\n\t\t\t}\n\t\t}\n\t}\n\tif err != nil \u0026\u0026 !errors.Is(err, context.DeadlineExceeded) {\n\t\tslog.Error(\"failed\", \"error\", err)\n\t}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdata%2Fsocks5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkdata%2Fsocks5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdata%2Fsocks5/lists"}