Giter Site home page Giter Site logo

shadowsocks-rust's Introduction

shadowsocks-rust

Build Status

This is a port of shadowsocks.

shadowsocks is a fast tunnel proxy that helps you bypass firewalls.

Currently developing and testing with rust-nightly

Note: Currently it is broken, need to be refactored with Eventloop (maybe with Coroutine), see #9.

Dependences

  • libcrypto (OpenSSL)
  • Rust nightly
  • Cargo

Usage

Build with Cargo:

cargo build

Then sslocal and ssserver will appear in ./target, it works similarly as the two binaries of the official shadowsocks' implementation.

Enable more crypto algorithms by passing the name cipher-[name] via command line argument --features

cargo build --features "cipher-aes-ctr"

Read Cargo.toml for more details.

Required libsodium and libcrypto by default.

Getting Started

Create a shadowsocks' configuration file. Example

{
    "server": "my_server_ip",
    "server_port": 8388,
    "local_address": "127.0.0.1",
    "local_port": 1080,
    "password": "mypassword",
    "timeout": 300,
    "method": "aes-256-cfb"
}

Detailed explaination could be found in shadowsocks' documentation.

In shadowsocks-rust, we also have a extended configuration file format, which is able to define more than one servers:

{
    "servers": [
        {
            "address": "127.0.0.1",
            "port": 1080,
            "password": "hello-world",
            "method": "bf-cfb",
            "timeout": 300,
        },
        {
            "address": "127.0.0.1",
            "port": 1081,
            "password": "hello-kitty",
            "method": "aes-128-cfb"
        }
    ],
    "local_port": 8388,
    "local_address": "127.0.0.1"
}

The sslocal will use a load balancing algorithm to dispatch packages to all servers.

Start local and server shadowsocks with

sslocal -c config.json
ssserver -c config.json

List all available arguments with -h.

Default log level is error, override it by setting environment variable RUST_LOG. Please refer to log crate for more detail.

Notes

Still under developing and waiting for the final release of rust-1.0.

It supports the following features:

  • CONNECT, UDP ASSOCIATE commands
  • Crypto algorithms defined in Cargo.toml
  • Load balancing

The socks5_cli.rs under the root directory is a Socks5 client for testing.

TODO

  • Documentation
  • BIND command (Maybe no one will use it)
  • Socks5 authentication
  • Extend configuration format
  • Fully testing on servers
  • Performance testing and improvement
  • User management
  • PAC
  • Improved logging format (waiting for the new official log crate)
  • Support more ciphers without depending on libcrypto (waiting for an acceptable Rust crypto lib implementation)

License

The MIT License (MIT)

Copyright (c) 2014 Y. T. CHUNG

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

shadowsocks-rust's People

Contributors

zonyitoo avatar

Watchers

 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.