A lightweight proxy client written in C, intends to support multiple protocols(trojan etc.)
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
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
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.
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
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_ACL=ON -DUSE_JEMALLOC=ON .. && make
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
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 featureThe "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 serverSET SERVER $idx
, which sets the current serverIn linux socat demo
Also, the system tray is supported, see below
Default compile binary without GUI, take parameter -DWITH_APPLET=ON
to enable system tray.
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_APPLET=ON . && make
To show the icon, put logo/icon.svg
to where pegas sit.
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
~/.config/.pegasrc
or ~/.config/pegas/config