Coder Social home page Coder Social logo

shadowsocks-asio's Introduction

shadowsocks-asio

CI

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.

Features

TODO:

  • Add IPv6 and rules support for access control list.
  • Add socks4a support.
  • Replace fmt with std::format (lack of compiler support).
  • Replace asio with std::net (it has not been standardized).

Get Started

Server

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

Client

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

Usage

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

How to build

Prerequisites

  • A compiler supporting C++20.
  • Python3 installed.

Building with Conan Package Manager

  1. Install Conan

    pip install conan -U
  2. Clone

    git clone https://github.com/ocfbnj/shadowsocks-asio --recurse-submodules
    cd shadowsocks-asio
    mkdir build && cd build
  3. 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.

    See https://ninja-build.org/

Dependent libraries

  • Asio is used to implement asynchronous logic in a synchronous manner.
  • mbedtls is used for encryption and decryption.
  • fmt is used to format strings.
  • spdlog is used for logging.

References

shadowsocks-asio's People

Contributors

ocfbnj avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.