An unofficial shadowsocks implementation that can work with official shadowsocks.
This project uses Asio network library, as well as the Coroutine and Concept features of C++20 to implement a concurrent server which can protect your Internet traffic.
- SOCKS5 CONNECT command
- AEAD ciphers
- Defend against replay attacks
- Access control list (IPv4 only)
- SIP002 URI scheme
TODO:
- Add IPv6 and rules support for access control list.
- Add socks4a support.
- Replace
fmt
withstd::format
(lack of compiler support). - Replace
asio
withstd::net
(it has not been standardized).
Start a server listening on port 5421 using chacha20-ietf-poly1305
AEAD cipher with password ocfbnj
.
shadowsocks-asio --Server -p 5421 -k ocfbnj -m chacha20-ietf-poly1305
Start a client connecting to the ocfbnj.cn
.
The client listens on port 1080 for incoming SOCKS5 connections and uses chacha20-ietf-poly1305
AEAD cipher with password ocfbnj
.
shadowsocks-asio --Client -s ocfbnj.cn -p 5421 -l 1080 -k ocfbnj -m chacha20-ietf-poly1305
shadowsocks-asio
A lightweight shadowsocks implementation using Asio and C++20 Coroutines.
USAGE: ./shadowsocks-asio [FLAGS] [OPTIONS]
FLAGS:
--Server Server mode (Default)
--Client Client mode
-h, --help Print help information
-v, --version Print version information
-V Verbose mode
OPTIONS:
-s <server host> Host name or IP address of your remote server
-p <server port> Port number of your remote server
-l <local port> Port number of your local server
-k <password> Password of your remote server
-m <encrypt method> Encrypt method:
aes-128-gcm, aes-256-gcm,
chacha20-ietf-poly1305 (Default)
--acl <file path> Access control list
--url <SS-URL> SS-URL
With SS-URL, you can connect to the remote server as shown above using the following command:
./shadowsocks-asio --Client -l 1080 --url ss://[email protected]:5421
- A compiler supporting C++20.
- Python3 installed.
-
Install Conan
pip install conan -U
-
Clone
git clone https://github.com/ocfbnj/shadowsocks-asio --recurse-submodules cd shadowsocks-asio mkdir build && cd build
-
Build
-
On Windows
cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release
-
On Linux or Mac OS
cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build .
Tip:
I prefer to use the Ninja generator.
-