All Projects → chux0519 → pegasocks

chux0519 / pegasocks

Licence: BSD-3-Clause license
A lightweight proxy client written in C, intends to support multiple protocols(trojan etc.)

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pegasocks

Trojan
trojan多用户管理部署程序, 支持web页面管理
Stars: ✭ 2,815 (+2413.39%)
Mutual labels:  trojan, trojan-gfw, trojan-go
Multi V2ray
v2ray/xray多用户管理部署程序
Stars: ✭ 5,382 (+4705.36%)
Mutual labels:  socks5, trojan, vmess
trojan-go-panel
🦄 trojan-go 管理面板。一键部署,多节点监控,多用户管理,可设置日期限制、流量限制,一键生成动态订阅链接。项目持续更新中,欢迎提出宝贵建议。
Stars: ✭ 42 (-62.5%)
Mutual labels:  trojan, trojan-gfw, trojan-go
V2ray Core
A platform for building proxies to bypass network restrictions.
Stars: ✭ 13,438 (+11898.21%)
Mutual labels:  socks5, trojan, vmess
Xray Core
Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
Stars: ✭ 6,908 (+6067.86%)
Mutual labels:  socks5, trojan, vmess
Qv2ray
⭐ Linux / Windows / macOS 跨平台 V2Ray 客户端 | 支持 VMess / VLESS / SSR / Trojan / Trojan-Go / NaiveProxy / HTTP / HTTPS / SOCKS5 | 使用 C++ / Qt 开发 | 可拓展插件式设计 ⭐
Stars: ✭ 12,886 (+11405.36%)
Mutual labels:  trojan, trojan-go
V2ray Agent
(VLESS+TCP+TLS/VLESS+TCP+XTLS/VLESS+gRPC+TLS/VLESS+WS+TLS/VMess+TCP+TLS/VMess+WS+TLS/Trojan+TCP+TLS/Trojan+gRPC+TLS/Trojan+TCP+XTLS)+伪装站点、八合一共存脚本,支持多内核安装
Stars: ✭ 4,133 (+3590.18%)
Mutual labels:  trojan, vmess
Kuhero
websocket proxy on heroku
Stars: ✭ 192 (+71.43%)
Mutual labels:  trojan, vmess
lightsocks-c
🌐 Light SOCKS5 proxy
Stars: ✭ 56 (-50%)
Mutual labels:  socks5, libevent
V2ray Desktop
最优雅的跨平台代理客户端,支持Shadowsocks(R),V2Ray和Trojan协议。The most elegant cross-platform proxy GUI client that supports Shadowsocks(R), V2Ray, and Trojan. Built with Qt5 and QML2.
Stars: ✭ 671 (+499.11%)
Mutual labels:  trojan, vmess
Proxysu
Xray,V2ray,Trojan,NaiveProxy, Trojan-Go, ShadowsocksR(SSR),Shadowsocks-libev及相关插件,MTProto+TLS 一键安装工具,windows下用(一键科学上网)
Stars: ✭ 3,309 (+2854.46%)
Mutual labels:  trojan, trojan-go
mieru
見える是一款 socks5 网络代理(科学上网)工具。Mieru is a socks5 proxy to bypass censorship.
Stars: ✭ 63 (-43.75%)
Mutual labels:  socks5, trojan
Shadowsocksr V2ray Trojan Android
A ShadowsocksR, V2Ray and Trojan client for Android
Stars: ✭ 1,290 (+1051.79%)
Mutual labels:  trojan, vmess
Xrayku
websocket proxy on heroku
Stars: ✭ 77 (-31.25%)
Mutual labels:  trojan, vmess
Blinksocks
A framework for building composable proxy protocol stack.
Stars: ✭ 587 (+424.11%)
Mutual labels:  socks5, vmess
Proxypool
自用代理池,支持socks/http/https/ss/ssr/vmess/vless/trojan爬取,自动检测可用性和速度,提供各平台订阅,支持按条件筛选和筛选模板,支持api控制和隧道模式,支持分体结构检测和统计
Stars: ✭ 699 (+524.11%)
Mutual labels:  trojan, vmess
Winxray
Xray / V2Ray( vmess/vless )、Shadowsocks、Trojan 通用客户端(Windows),可自动维持稳定上网 - 代理服务器异常自动切换,并提供一键部署代理服务端工具,使用 aardio 编写,绿色便携版免安装仅740KB、不需要.Net等外部运行库。
Stars: ✭ 241 (+115.18%)
Mutual labels:  trojan, vmess
Leaf
A lightweight and fast proxy utility tries to include any useful features.
Stars: ✭ 530 (+373.21%)
Mutual labels:  trojan, vmess
Free
翻墙、免费翻墙、免费科学上网、免费节点、免费梯子、免费ss/v2ray/trojan节点、蓝灯、谷歌商店、翻墙梯子
Stars: ✭ 16,689 (+14800.89%)
Mutual labels:  trojan, vmess
V2ray Core
A platform for building proxies to bypass network restrictions.
Stars: ✭ 38,782 (+34526.79%)
Mutual labels:  socks5, vmess

pegasocks Cirrus CI Build Status

is a (socks5)proxy client written in C, intended to support multiple types of proxy protocols(trojan, v2ray, *shadowsock, ..). It is lightweight and supports unix-like systems(Linux/WSL/BSDs/OSX).

⚠️ This project is under development, please consider the cost and risk of use at your own discretion.

中文 | English

Features

Unlike 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

  1. 🍃 is light enough that there are no QT or boost or other third-party binary dependencies.
  2. 🚀 Performance-first, with multiple worker threads by default, so theoretically higher throughput to be benchmarked)
  3. 🚥 This is a learn by doing project, feel free to review the code, provide optimization ideas and C programming related guidance.
  4. 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.

Dependencies

  • openssl 1.1.1 / mbedtls 2.27.0
  • libevent2.12 (on OSX, need the latest version)
  • pcre (lagacy) optional,will need it when ACL is enabled

Other dependencies are managed through git submodule, so you need to run following command after git clone.

git submodule update --init

Or add --recursive parameter in git clone command.

Install

If you use Arch Linux, you can install the latest version via AUR

yay -S pegasocks-git --overwrite /usr/local/bin/pegas,/usr/local/share/pegasocks/*

Or you can build it yourself as following

Build

mkdir build && cd build

cmake -DCMAKE_BUILD_TYPE=Release -DWITH_ACL=ON -DUSE_JEMALLOC=ON .. && make

Cmake Options

option meaning default
-DUSE_MBEDTLS Whether to use mbedtls instead of openssl OFF
-DUSE_JEMALLOC Whether to use jemalloc OFF
-DUSE_STATIC Whether to use static links OFF
-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
-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

You can also customize the search root of JeMalloc/Libevent2/MbedTLS/OpenSSLx/PCRE with the following parameters.

-DOpenSSLx_ROOT=/xxxxxx/xxx/xxx for openssl root

-DLibevent2_ROOT=xxxxxx for libevent root

and so on

Run

pegas -c config.json -t 4

  • -c specifies the configuration file, by default it will try $XDG_CONFIG_HOME/.pegasrc or $XDG_CONFIG_HOME/pegas/config in order
  • -t specifies the number of worker threads, default is 4
  • -a specifies the ACL file if pegas is build with ACL feature

Configuration

see man page or wiki

Interaction

The "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.

  • GET SERVERS, which will return information about the server
  • SET SERVER $idx, which sets the current server

In linux socat demo

Also, the system tray is supported, see below

System Tray

Default compile binary without GUI, take parameter -DWITH_APPLET=ON to enable system tray.

cmake -DCMAKE_BUILD_TYPE=Release -DWITH_APPLET=ON . && make

Linux

To show the icon, put logo/icon.svg to where pegas sit.

OSX

On OSX, the binary will be packaged into an app bundle by default, just copy the packaged build/PegasApp.app to the application directly.

⚠️Note: If you encounter a situation where you can't start or hit a crash, please make sure that

  1. the latest libevent is installed in your system (do it manually, libevent2.12 from homebew will cause this issue)
  2. if there is a configuration file, the app bundle will detect ~/.config/.pegasrc or ~/.config/pegas/config
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].