{"id":19865714,"url":"https://github.com/heiher/hev-socks5-server","last_synced_at":"2026-01-27T18:14:29.358Z","repository":{"id":12320113,"uuid":"14956187","full_name":"heiher/hev-socks5-server","owner":"heiher","description":"A socks5 server (Linux/Android/BSD/macOS/iOS/Windows)","archived":false,"fork":false,"pushed_at":"2025-05-03T10:31:56.000Z","size":366,"stargazers_count":372,"open_issues_count":1,"forks_count":53,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-12T02:56:38.100Z","etag":null,"topics":["android","dns","freebsd","high-performance","ipv4","ipv6","linux","macos","socks5","socks5-proxy","socks5-server","tcp","udp","windows"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fschulze/pytest-warnings","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heiher.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,"zenodo":null}},"created_at":"2013-12-05T14:45:24.000Z","updated_at":"2025-05-07T02:13:15.000Z","dependencies_parsed_at":"2024-01-24T16:28:54.178Z","dependency_job_id":"3d50ae3f-7e83-45d0-8ad2-e12704bc1b78","html_url":"https://github.com/heiher/hev-socks5-server","commit_stats":null,"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiher%2Fhev-socks5-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiher%2Fhev-socks5-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiher%2Fhev-socks5-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiher%2Fhev-socks5-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heiher","download_url":"https://codeload.github.com/heiher/hev-socks5-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485065,"owners_count":22078767,"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":["android","dns","freebsd","high-performance","ipv4","ipv6","linux","macos","socks5","socks5-proxy","socks5-server","tcp","udp","windows"],"created_at":"2024-11-12T15:23:52.817Z","updated_at":"2026-01-27T18:14:29.317Z","avatar_url":"https://github.com/heiher.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# HevSocks5Server\n\n[![status](https://github.com/heiher/hev-socks5-server/actions/workflows/build.yaml/badge.svg?branch=master\u0026event=push)](https://github.com/heiher/hev-socks5-server)\n\nHevSocks5Server is a simple, lightweight socks5 server.\n\n## Features\n\n* IPv4/IPv6. (dual stack)\n* Standard `CONNECT` command.\n* Standard `UDP ASSOCIATE` command. [^1]\n* Extended `FWD UDP` command. (UDP in TCP) [^2]\n* Multiple username/password authentication.\n\n## Benchmarks\n\nSee [here](https://github.com/heiher/hev-socks5-server/wiki/Benchmarks) for more details.\n\n### Speed\n\n![](https://github.com/heiher/hev-socks5-server/wiki/res/upload-speed.png)\n![](https://github.com/heiher/hev-socks5-server/wiki/res/download-speed.png)\n\n### CPU usage\n\n![](https://github.com/heiher/hev-socks5-server/wiki/res/upload-cpu.png)\n![](https://github.com/heiher/hev-socks5-server/wiki/res/download-cpu.png)\n\n### Memory usage\n\n![](https://github.com/heiher/hev-socks5-server/wiki/res/upload-mem.png)\n![](https://github.com/heiher/hev-socks5-server/wiki/res/download-mem.png)\n\n## How to Build\n\n### Unix\n\n```bash\ngit clone --recursive https://github.com/heiher/hev-socks5-server\ncd hev-socks5-server\nmake\n\n# statically link\nmake ENABLE_STATIC=1\n```\n\n### Android\n\n```bash\nmkdir hev-socks5-server\ncd hev-socks5-server\ngit clone --recursive https://github.com/heiher/hev-socks5-server jni\ncd jni\nndk-build\n```\n\n### iOS and MacOS\n\n```bash\ngit clone --recursive https://github.com/heiher/hev-socks5-server\ncd hev-socks5-server\n# will generate HevSocks5Server.xcframework\n./build-apple.sh\n```\n\n### Windows (MSYS2)\n\n```bash\nexport MSYS=winsymlinks:native\ngit clone --recursive https://github.com/heiher/hev-socks5-server\ncd hev-socks5-server\nmake LFLAGS=\"-lmsys-2.0 -lws2_32\"\n```\n\n## How to Use\n\n### Config\n\n```yaml\nmain:\n  # Worker threads\n  workers: 4\n  # Listen port\n  port: 1080\n  # Listen address (ipv4|ipv6)\n  listen-address: '::'\n  # UDP listen port\n  udp-port: 1080\n  # UDP listen address (ipv4|ipv6)\n# udp-listen-address: '::1'\n  # Listen ipv6 only\n  listen-ipv6-only: false\n  # Bind source address (ipv4|ipv6)\n  # It is overridden by bind-address-v{4,6} if specified\n  bind-address: ''\n  # Bind source address (ipv4)\n  bind-address-v4: ''\n  # Bind source address (ipv6)\n  bind-address-v6: ''\n  # Bind source network interface\n  bind-interface: ''\n  # Domain address type (ipv4|ipv6|unspec)\n  domain-address-type: unspec\n  # Socket mark (hex: 0x1, dec: 1, oct: 01)\n  mark: 0\n\n#auth:\n#  file: conf/auth.txt\n#  username:\n#  password:\n\n#misc:\n   # task stack size (bytes)\n#  task-stack-size: 8192\n   # connect timeout (ms)\n#  connect-timeout: 5000\n   # read-write timeout (ms)\n#  read-write-timeout: 60000\n   # stdout, stderr or file-path\n#  log-file: stderr\n   # debug, info, warn or error\n#  log-level: warn\n   # If present, run as a daemon with this pid file\n#  pid-file: /run/hev-socks5-server.pid\n   # If present, set rlimit nofile; else use default value\n#  limit-nofile: 65535\n```\n\n### Authentication file\n\n```\n\u003cUSERNAME\u003e \u003cSPACE\u003e \u003cPASSWORD\u003e \u003cSPACE\u003e \u003cMARK\u003e \u003cLF\u003e\n```\n\n- USERNAME: A string of up to 255 characters\n- PASSWORD: A string of up to 255 characters\n- MARK: Hexadecimal\n\n### Run\n\n```bash\nbin/hev-socks5-server conf/main.yml\n```\n\n### Live updating authentication file\n\nSend signal `SIGUSR1` to socks5 server process after the authentication file is updated.\n\n```bash\nkillall -SIGUSR1 hev-socks5-server\n```\n\n### Limit number of connections\n\nFor example, limit the number of connections for `jerry` up to `2`:\n\n#### Config\n\n```yaml\nauth:\n  file: conf/auth.txt\n```\n\n#### Auth file\n\n```\njerry pass 1a\n```\n\n#### IPtables\n\n```bash\niptables -A OUTPUT -p tcp --syn -m mark --mark 0x1a -m connlimit --connlimit-above 2 -j REJECT\n```\n\n## API\n\n```c\n/**\n * hev_socks5_server_main_from_file:\n * @config_path: config file path\n *\n * Start and run the socks5 server, this function will blocks until the\n * hev_socks5_server_quit is called or an error occurs.\n *\n * Returns: returns zero on successful, otherwise returns -1.\n *\n * Since: 2.6.7\n */\nint hev_socks5_server_main_from_file (const char *config_path);\n\n/**\n * hev_socks5_server_main_from_str:\n * @config_str: string config\n * @config_len: the byte length of string config\n *\n * Start and run the socks5 server, this function will blocks until the\n * hev_socks5_server_quit is called or an error occurs.\n *\n * Returns: returns zero on successful, otherwise returns -1.\n *\n * Since: 2.6.7\n */\nint hev_socks5_server_main_from_str (const unsigned char *config_str,\n                                     unsigned int config_len);\n\n/**\n * hev_socks5_server_quit:\n *\n * Stop the socks5 server.\n *\n * Since: 2.6.7\n */\nvoid hev_socks5_server_quit (void);\n```\n\n## Use Cases\n\n### Android App\n\n* [Socks5](https://github.com/heiher/socks5)\n\n### iOS App\n\n* [Socks5](https://github.com/heiher/socks5-ios)\n\n## Contributors\n\n* **ammar faizi** - https://github.com/ammarfaizi2\n* **hev** - https://hev.cc\n* **pexcn** - \u003ci@pexcn.me\u003e\n\n## License\n\nMIT\n\n[^1]: Windows is not supported at this time.\n[^2]: The [hev-socks5-tunnel](https://github.com/heiher/hev-socks5-tunnel) and [hev-socks5-tproxy](https://github.com/heiher/hev-socks5-tproxy) clients support UDP relay over TCP.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheiher%2Fhev-socks5-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheiher%2Fhev-socks5-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheiher%2Fhev-socks5-server/lists"}