chux0519 / pegasocks

A lightweight proxy client written in C, intends to support multiple protocols(trojan etc.)
BSD 3-Clause "New" or "Revised" License
116 stars 35 forks source link

[Feature Request] add support for shadowsocks(R) #16

Open mokhtarabadi opened 2 years ago

mokhtarabadi commented 2 years ago

In Iran shadowsocks is very useful, did you have any plan to implement this? because there is shadowsocks c version (libev) i think it can be done easily also shadowsocksR is a good option, but not important

chux0519 commented 2 years ago

Yeah, since there're still many people using it, I think I will add shadowsocks support later. (I've used shadowsocks for a while, and in our country the GFW seems to have the ability to detect the protocol, then I quit it and use other protocols, so I did not implement it currently)

chux0519 commented 2 years ago

after PR: https://github.com/chux0519/pegasocks/pull/21 TCP mode is working now, all AEAD ciphers in http://shadowsocks.org/en/wiki/AEAD-Ciphers.html is supported, for stream cipher, only aes-128-cfb is implemented.

here is a example config

 {
      "server_address": <HOST>,
      "server_type": "shadowsocks",
      "server_port": <PORT>,
      "password": <PASSWORD>,
      "method": "aes-128-cfb/aes-128-gcm/aes-256-gcm/chacha20-poly1305"
    }

PS: In this PR, I cleaned the code and restructured the source files for better maintenance purpose. so many things changed, use v0.1.0 branch if you have compatibility issues in existing projects

TODOs