shadowsocks-rust
This is a port of shadowsocks.
shadowsocks is a fast tunnel proxy that helps you bypass firewalls.
It is unstable! If you encounter any problems, please open an issue.
Dependencies
- libcrypto (OpenSSL)
- libsodium
Usage
Install from crates.io:
then you can find sslocal
and ssserver
in $CARGO_HOME/bin
.
or you can also build with Cargo:
Then sslocal
and ssserver
will appear in ./target
, it works similarly as the two binaries in
the official ShadowSocks' implementation.
Enable more crypto algorithms by passing the name cipher-[name]
via command line argument --features
Read Cargo.toml
for more details.
Getting Started
Create a ShadowSocks' configuration file. Example
Detailed explaination could be found in shadowsocks' documentation.
In shadowsocks-rust, we also have an extended configuration file format, which is able to define more than one servers:
The sslocal
will use a load balancing algorithm to dispatch packages to all servers.
Start local and server ShadowSocks with
cargo run --bin sslocal -- -c config.json
cargo run --bin ssserver -- -c config.json
List all available arguments with -h
.
Useful Tools
ssurl
is for encoding and decoding ShadowSocks URLs. Example:ss://YWVzLTI1Ni1jZmI6aGVsbG93b3JsZF9mdWNrQDEyNy4wLjAuMTo4Mzg4
Notes
It supports the following features:
- Socks5 CONNECT command
- UDP ASSOCIATE command (partial)
- HTTP Proxy protocol
- Various crypto algorithms
- Load balancing (multiple servers)
TODO
- Documentation
- Extend configuration format
- 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) - Windows support. (Depending on mio and coio-rs)
- Build with stable. (Depending on coio)
- Support HTTP Proxy protocol
License
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.