{"id":23817794,"url":"https://github.com/lsongdev/socks-go","last_synced_at":"2026-02-22T20:38:53.780Z","repository":{"id":68774120,"uuid":"601545692","full_name":"lsongdev/socks-go","owner":"lsongdev","description":"simple socks5 client and server implementation in go","archived":false,"fork":false,"pushed_at":"2025-01-07T05:33:48.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T03:05:00.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/lsongdev.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":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"song940","patreon":"song940","open_collective":"song940","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://git.io/fjRcB"}},"created_at":"2023-02-14T09:48:18.000Z","updated_at":"2025-01-13T08:52:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d21b97c-4cf7-4563-b729-1ac8d17bb308","html_url":"https://github.com/lsongdev/socks-go","commit_stats":null,"previous_names":["lsongdev/socks5-go","lsongdev/socks-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lsongdev/socks-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fsocks-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fsocks-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fsocks-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fsocks-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsongdev","download_url":"https://codeload.github.com/lsongdev/socks-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fsocks-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29726251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T20:09:16.275Z","status":"ssl_error","status_checked_at":"2026-02-22T20:09:13.750Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-01-02T05:48:47.240Z","updated_at":"2026-02-22T20:38:53.772Z","avatar_url":"https://github.com/lsongdev.png","language":"Go","funding_links":["https://github.com/sponsors/song940","https://patreon.com/song940","https://opencollective.com/song940","https://git.io/fjRcB"],"categories":[],"sub_categories":[],"readme":"# socks-go\n\nsimple socks5 client and server implementation in go\n\n## example\n\n### simple socks5 client\n\n```go\nfunc main(){\n\n  client := socks.NewClient(\u0026socks.ClientConfig{\n    Host: \"example.com\",\n    Port: 1080,\n    User: \u0026socks.User{\n      Username: \"username\",\n      Password: \"password\",\n    },\n  })\n  conn, err := client.Dial(\"tcp\", \"example.com:80\")\n  if err != nil {\n    log.Fatal(err)\n  }\n  defer conn.Close()\n  if _, err := conn.Write([]byte(\"GET / HTTP/1.0\\r\\n\\r\\n\")); err != nil {\n    log.Fatal(err)\n  }\n  io.Copy(os.Stdout, conn)\n}\n```\n\n### simple socks5 server\n\n```go\npackage main\n\nimport (\n  \"io\"\n  \"log\"\n\n  \"github.com/lsongdev/socks-go/socks\"\n)\n\ntype MyHandler struct {\n  socks.DefaultServerHandler\n\n  client *socks.Client\n}\n\nfunc (h *MyHandler) HandleAuth(user *socks.User) error {\n  log.Println(\"User\", user)\n  return nil\n}\n\nfunc (h *MyHandler) HandleRequest(conn *socks.PacketConn) {\n  log.Println(\"--\u003e\", conn.Address())\n  dest, err := h.client.Dial(\"tcp\", conn.Address())\n  if err != nil {\n    log.Printf(\"Failed to connect to %s: %v\", conn.Address(), err)\n    conn.SendStatus(socks.HOST_UNREACHABLE) // Host unreachable\n    return\n  }\n  defer dest.Close()\n  // Send success response\n  if err := conn.SendStatus(socks.SUCCESS); err != nil {\n    log.Printf(\"Failed to send response: %v\", err)\n    return\n  }\n  // Start proxying data\n  go func() {\n    defer conn.Close()\n    defer dest.Close()\n    io.Copy(dest, conn)\n  }()\n  io.Copy(conn, dest)\n}\n\nfunc main() {\n\n  client := socks.NewClient(\u0026socks.ClientConfig{\n    Host: \"example.com\",\n    Port: 1080,\n    User: \u0026socks.User{\n      Username: \"username\",\n      Password: \"password\",\n    },\n  })\n\n  h := \u0026MyHandler{\n    client: client,\n  }\n  server := socks.NewServer()\n  log.Printf(\"Starting SOCKS5 server on :1080\")\n  if err := server.ListenAndServe(\":1080\", h); err != nil {\n    log.Fatal(err)\n  }\n}\n```\n\n## license\n\nsee [LICENSE](https://github.com/lsongdev/.github/blob/main/LICENSE.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsongdev%2Fsocks-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsongdev%2Fsocks-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsongdev%2Fsocks-go/lists"}