{"id":18772866,"url":"https://github.com/chux0519/pegasocks","last_synced_at":"2025-10-06T06:20:41.308Z","repository":{"id":40360150,"uuid":"274644918","full_name":"chux0519/pegasocks","owner":"chux0519","description":"A lightweight proxy client written in C, intends to support multiple protocols(trojan etc.)","archived":false,"fork":false,"pushed_at":"2024-03-21T10:42:23.000Z","size":1329,"stargazers_count":117,"open_issues_count":7,"forks_count":36,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-07T22:12:47.573Z","etag":null,"topics":["client","libevent","proxy","socks5","trojan","trojan-gfw","trojan-go","vmess","vmess-wss"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chux0519.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-24T10:50:08.000Z","updated_at":"2024-07-24T03:47:32.000Z","dependencies_parsed_at":"2022-07-12T12:50:46.957Z","dependency_job_id":"219d2718-f74e-495c-820c-76026c0c1c76","html_url":"https://github.com/chux0519/pegasocks","commit_stats":{"total_commits":241,"total_committers":3,"mean_commits":80.33333333333333,"dds":0.08298755186721996,"last_synced_commit":"8bf0a33ec25498f798bddade1e1425581d1afe6e"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chux0519/pegasocks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chux0519%2Fpegasocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chux0519%2Fpegasocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chux0519%2Fpegasocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chux0519%2Fpegasocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chux0519","download_url":"https://codeload.github.com/chux0519/pegasocks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chux0519%2Fpegasocks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271397956,"owners_count":24752640,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["client","libevent","proxy","socks5","trojan","trojan-gfw","trojan-go","vmess","vmess-wss"],"created_at":"2024-11-07T19:31:21.352Z","updated_at":"2025-10-06T06:20:36.269Z","avatar_url":"https://github.com/chux0519.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./logo/icon.svg\" width=\"150\" align=\"left\" /\u003e\n\n# pegasocks [![Cirrus CI Build Status](https://api.cirrus-ci.com/github/chux0519/pegasocks.svg)](https://cirrus-ci.com/github/chux0519/pegasocks)\n\nis a (socks5)proxy client written in C, intended to support multiple types of proxy protocols(trojan, v2ray, \\*shadowsock, ..).\nIt is lightweight and supports unix-like systems(Linux/WSL/BSDs/OSX).\n\n⚠️ This project is under development, please consider the cost and risk of use at your own discretion.\n\n[中文](./README_zh.md) | English\n\n## Features\n\nUnlike most other clients that support multiple protocols, pegasocks does not rely on various third-party cores (e.g. v2ray-core, etc.), but really goes for the disassembly of the relevant protocols and takes care of performance as much as possible. Therefore it\n\n1. 🍃 is light enough that there are no QT or boost or other third-party binary dependencies.\n2. 🚀 Performance-first, with multiple worker threads by default, so theoretically higher throughput to be benchmarked)\n3. 🚥 This is a learn by doing project, feel free to review the code, provide optimization ideas and C programming related guidance.\n4. ❌ There is no GUI, you can directly work with systemd, launchd, rc or various custom scripts toconfigure the bootu.But you can optianly choose to build a simple tray indicator to interact with it, but in short, a heavy-duty GUI is not under consideration.\n\n## Dependencies\n\n- openssl 1.1.1 / mbedtls 2.27.0\n- libevent2.12 (on OSX, need the [latest](https://github.com/libevent/libevent/tree/master) version)\n- pcre (lagacy) optional，will need it when ACL is enabled\n\nOther dependencies are managed through git submodule, so you need to run following command after git clone.\n\n\u003e git submodule update --init\n\nOr add `--recursive` parameter in `git clone` command.\n\n## Install\n\nIf you use Arch Linux, you can install the latest version via AUR\n\n\u003e yay -S pegasocks-git --overwrite /usr/local/bin/pegas,/usr/local/share/pegasocks/*\n\nOr you can build it yourself as following\n\n## Build\n\n\u003e mkdir build \u0026\u0026 cd build\n\u003e\n\u003e cmake -DCMAKE_BUILD_TYPE=Release -DWITH_ACL=ON -DUSE_JEMALLOC=ON .. \u0026\u0026 make\n\n### Cmake Options\n\n|option|meaning|default|\n| --- | --- | --- |\n|-DUSE_MBEDTLS|Whether to use mbedtls instead of openssl| OFF|\n|-DUSE_JEMALLOC|Whether to use jemalloc| OFF|\n|-DUSE_STATIC|Whether to use static links| OFF |\n|-DWITH_ACL|Whether to open ACL support (this will use more dependencies( libcork/ipset/PCRE ), so it will increase the final size of the program)| OFF |\n|-DWITH_APPLET|Whether to enable system tray support (this will depend on some system libraries and will therefore increase the final size of the program)| OFF |\n\nYou can also customize the search root of JeMalloc/Libevent2/MbedTLS/OpenSSLx/PCRE with the following parameters.\n\n\u003e -DOpenSSLx_ROOT=/xxxxxx/xxx/xxx for openssl root\n\u003e \n\u003e -DLibevent2_ROOT=xxxxxx  for libevent root\n\u003e \n\u003e and so on\n\n## Run\n\n\u003e pegas -c config.json -t 4\n\n- `-c` specifies the configuration file, by default it will try `$XDG_CONFIG_HOME/.pegasrc` or `$XDG_CONFIG_HOME/pegas/config` in order \n- `-t` specifies the number of worker threads, default is 4\n- `-a` specifies the ACL file if pegas is build with ACL feature\n\n## Configuration\n\nsee [man page](https://github.com/chux0519/pegasocks/wiki/manpage) or [wiki](https://github.com/chux0519/pegasocks/wiki/%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E)\n\n\n## Interaction\n\nThe \"control_port\" or \"control_file\" field of the configuration file can be used to open a TCP port or a unix socket to interact with the program. Use netcat / socat to interact with the relevant port or file.\n\n- `GET SERVERS`, which will return information about the server\n- `SET SERVER $idx`, which sets the current server\n\nIn linux socat demo\n\n\u003cimg src=\"https://i.imgur.com/dlFuKtg.png\" width=\"512\" /\u003e\n\nAlso, the system tray is supported, see below\n\n## System Tray\n\nDefault compile binary without GUI, take parameter `-DWITH_APPLET=ON` to enable system tray.\n\n\u003e cmake -DCMAKE_BUILD_TYPE=Release -DWITH_APPLET=ON . \u0026\u0026 make\n\n### Linux \n\n\u003cimg src=\"https://i.imgur.com/Ny0WMJA.png\" width=\"512\" /\u003e\n\nTo show the icon, put `logo/icon.svg` to where pegas sit.\n\n\n### OSX\n\n\u003cimg src=\"https://i.imgur.com/jOA04aU.png\" width=\"512\" /\u003e\n\nOn OSX, the binary will be packaged into an app bundle by default, just copy the packaged `build/PegasApp.app` to the application directly.\n\n⚠️Note: If you encounter a situation where you can't start or hit a crash, please make sure that\n\n1. the latest libevent is installed in your system (do it manually, libevent2.12 from homebew will cause [this issue](https://github.com/chux0519/pegasocks/issues/23))\n2. if there is a **configuration** file, the app bundle will detect `~/.config/.pegasrc` or `~/.config/pegas/config`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchux0519%2Fpegasocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchux0519%2Fpegasocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchux0519%2Fpegasocks/lists"}