readme: refine structure; add info about mbedTLS.

This commit is contained in:
Boyuan Yang
2015-12-22 15:59:22 +08:00
parent 0d58018dac
commit 3d487d5157
+61 -6
View File
@@ -18,22 +18,74 @@ Travis CI: [![Travis CI](https://travis-ci.org/shadowsocks/shadowsocks-libev.svg
Shadowsocks-libev is written in pure C and only depends on Shadowsocks-libev is written in pure C and only depends on
[libev](http://software.schmorp.de/pkg/libev.html) and [libev](http://software.schmorp.de/pkg/libev.html) and
[OpenSSL](http://www.openssl.org/) or [PolarSSL](https://polarssl.org/). [OpenSSL](http://www.openssl.org/) or [PolarSSL](https://polarssl.org/).
The use of [mbedTLS](https://tls.mbed.org/) is added but still for testing, and
it is not officially supported yet.
In normal usage, the memory footprint is about 600KB and the CPU utilization is In normal usage, the memory footprint is about 600KB and the CPU utilization is
no more than 5% on a low-end router (Buffalo WHR-G300N V2 with a 400MHz MIPS CPU, no more than 5% on a low-end router (Buffalo WHR-G300N V2 with a 400MHz MIPS CPU,
32MB memory and 4MB flash). 32MB memory and 4MB flash).
For a full list of feature comparison between different versions of shadowsocks,
refer to the [Wiki page](https://github.com/shadowsocks/shadowsocks/wiki/Feature-Comparison-across-Different-Versions).
## Installation ## Installation
**Notes about PolarSSL** ### Distribution-specific guide
- [Debian & Ubuntu](#debian--ubuntu)
+ [Install from repository](#install-from-repository)
+ [Build deb package from source](#build-deb-package-from-source)
+ [Configure and start the service](#configure-and-start-the-service)
- [Fedora & RHEL](#fedora--rhel)
+ [Install from repository](#install-from-repository-1)
- [Archlinux](#archlinux)
- [Directly build and install on UNIX-like system](#linux)
- [FreeBSD](#freebsd)
- [OpenWRT](#openwrt)
- [OS X](#os-x)
- [Windows](#windows)
* * *
### Pre-build configure guide
For a complete list of avaliable configure-time option,
try `configure --help`.
#### Using alternative crypto library
There are three crypto libraries available:
- OpenSSL (**default**)
- PolarSSL
- mbedTLS (__NOT__ officially supported)
##### PolarSSL
To build against PolarSSL, specify `--with-crypto-library=polarssl`
and `--with-polarssl=/path/to/polarssl` when running `./configure`.
* The default crypto library is OpenSSL. To build against PolarSSL,
specify `--with-crypto-library=polarssl` and `--with-polarssl=/path/to/polarssl`
when running `./configure`.
* PolarSSL __1.2.5 or newer__ is required. Currently, PolarSSL does __NOT__ support * PolarSSL __1.2.5 or newer__ is required. Currently, PolarSSL does __NOT__ support
CAST5-CFB, DES-CFB, IDEA-CFB, RC2-CFB and SEED-CFB. CAST5-CFB, DES-CFB, IDEA-CFB, RC2-CFB and SEED-CFB.
* RC4 is only support by PolarSSL __1.3.0 or above__. * RC4 is only support by PolarSSL __1.3.0 or above__.
##### mbedTLS
To build against mbedTLS, specify `--with-crypto-library=mbedtls`
and `--with-mbedtls=/path/to/mbedtls` when running `./configure`.
Please not that we do **NOT** officially support mbedTLS right now,
and you should use it at your own risk.
Windows users will need extra work when compiling mbedTLS library,
see [this issue](https://github.com/shadowsocks/shadowsocks-libev/issues/422) for detail info.
#### Using shared library from system
Please specify `--enable-system-shared-lib`. This will replace the bundled
`libev`, `libsodium` and `libudns` with the corresponding libraries installed
in the system during compilation and linking.
### Debian & Ubuntu ### Debian & Ubuntu
#### Install from repository #### Install from repository
@@ -82,7 +134,7 @@ Please follow the instructions on [Debian Backports](http://backports.debian.org
This also means that you can only install those built packages on systems that have This also means that you can only install those built packages on systems that have
`init-system-helpers` installed. `init-system-helpers` installed.
Otherwise, try to build and install directly from source. See the **Linux** Otherwise, try to build and install directly from source. See the [Linux](#linux)
section below. section below.
``` bash ``` bash
@@ -145,7 +197,7 @@ sudo pacman -S shadowsocks-libev
``` ```
Please refer to downstream [PKGBUILD](https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/shadowsocks-libev) Please refer to downstream [PKGBUILD](https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/shadowsocks-libev)
script for extra modifications. script for extra modifications and distribution-specific bugs.
### Linux ### Linux
@@ -182,6 +234,9 @@ service shadowsocks_libev start
### OpenWRT ### OpenWRT
**Note**: You may want to use [openwrt-shadowsocks](https://github.com/shadowsocks/openwrt-shadowsocks)
, which is developed specifically for OpenWRT.
```bash ```bash
# At OpenWRT build root # At OpenWRT build root
pushd package pushd package