You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
5.3 KiB

12 years ago
12 years ago
12 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
12 years ago
11 years ago
12 years ago
11 years ago
11 years ago
11 years ago
11 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
11 years ago
12 years ago
11 years ago
12 years ago
11 years ago
12 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
12 years ago
11 years ago
12 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. shadowsocks-libev
  2. =================
  3. Intro
  4. -----
  5. [Shadowsocks-libev](http://shadowsocks.org) is a lightweight secured scoks5
  6. proxy for embedded devices and low end boxes.
  7. It is a port of [shadowsocks](https://github.com/clowwindy/shadowsocks)
  8. created by [@clowwindy](https://github.com/clowwindy) maintained by
  9. [@madeye](https://github.com/madeye).
  10. Current version: 1.3.3 [![Build Status](https://travis-ci.org/madeye/shadowsocks-libev.png?branch=master)](https://travis-ci.org/madeye/shadowsocks-libev)
  11. Changelog
  12. ---------
  13. 1.3.3 -- Fri, 21 Jun 2013 09:59:20 +0800
  14. * Provide more info in verbose mode.
  15. 1.3.2 -- Sun, 09 Jun 2013 09:52:31 +0000
  16. * Fix some ciphers by @linusyang.
  17. 1.3.1 -- Tue, 04 Jun 2013 00:56:17 +0000
  18. * Support more cihpers: camellia, idea, rc2 and seed.
  19. 1.3 -- Thu, 16 May 2013 10:51:15 +0800
  20. * Able to bind connections to specific interface
  21. * Support more ciphers: aes-128-cfb, aes-192-cfb, aes-256-cfb, bf-cfb, cast5-cfb, des-cfb
  22. 1.2 -- Tue, 07 May 2013 14:10:33 +0800
  23. * Close timeouted TCP connections
  24. * Fix a high load issue
  25. 1.1 -- Wed, 10 Apr 2013 12:11:36 +0800
  26. * Fix a IPV6 resolve issue
  27. 1.0 -- Sat, 06 Apr 2013 16:59:15 +0800
  28. * Initial release
  29. Features
  30. --------
  31. Shadowsocks-libev is writen in pure C and only depends on
  32. [libev](http://software.schmorp.de/pkg/libev.html) and
  33. [openssl](http://www.openssl.org/).
  34. In normal usage, the memory consumption is about 600KB and the CPU utilization is
  35. no more than 5% on a low-end router (Buffalo WHR-G300N V2 with a 400MHz MIPS CPU,
  36. 32MB memory and 4MB flash).
  37. Installation
  38. ------------
  39. Build the binary like this:
  40. ```bash
  41. sudo apt-get install build-essential autoconf libtool libssl-dev
  42. ./configure && make
  43. sudo make install
  44. ```
  45. Usage
  46. -----
  47. ```
  48. usage:
  49. ss-[local|redir|server]
  50. -s <server_host> -p <server_port>
  51. -l <local_port> -k <password>
  52. [-m <encrypt_method>] [-f <pid_file>]
  53. [-t <timeout>] [-c <config_file>]
  54. [-i <interface>] [-b <local_address>]
  55. options:
  56. encrypt_method: table, rc4,
  57. aes-128-cfb, aes-192-cfb, aes-256-cfb,
  58. bf-cfb, camellia-128-cfb, camellia-192-cfb,
  59. camellia-256-cfb, cast5-cfb, des-cfb,
  60. idea-cfb, rc2-cfb and seed-cfb
  61. pid_file: valid path to the pid file
  62. timeout: socket timeout in senconds
  63. config_file: json format config file
  64. interface: specific network interface to bind,
  65. only avaliable in local and server modes
  66. local_address: specific local address to bind,
  67. only avaliable in local and redir modes
  68. notes:
  69. ss-redir provides a transparent proxy function and only works on the
  70. Linux platform with iptables.
  71. ```
  72. ## Advanced usage
  73. The latest shadowsocks-libev has provided a *redir* mode. You can configure your linux based box or router to proxy all tcp traffic transparently.
  74. # Create new chain
  75. root@Wrt:~# iptables -t nat -N SHADOWSOCKS
  76. # Ignore your shadowsocks server's addresses
  77. # It's very IMPORTANT, just be careful.
  78. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 123.123.123.123 -j RETURN
  79. # Ignore LANs and any other addresses you'd like to bypass the proxy
  80. # See Wikipedia and RFC5735 for full list of reserved networks.
  81. # See ashi009/bestroutetb for a highly optimized CHN route list.
  82. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
  83. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN
  84. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 127.0.0.0/8 -j RETURN
  85. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 169.254.0.0/16 -j RETURN
  86. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 172.16.0.0/12 -j RETURN
  87. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 192.168.0.0/16 -j RETURN
  88. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 224.0.0.0/4 -j RETURN
  89. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 240.0.0.0/4 -j RETURN
  90. # Anything else should be redirected to shadowsocks's local port
  91. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 12345
  92. # Apply the rules
  93. root@Wrt:~# iptables -t nat -A OUTPUT -p tcp -j SHADOWSOCKS
  94. # Start the shadowsocks-redir
  95. root@Wrt:~# ss-redir -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid
  96. ## Security Tips
  97. Although shadowsocks-libev can handle thousands of concurrent connections nicely, we still recommend to
  98. set up your server's firewall rules to limit connections from each user.
  99. # Up to 32 connections are enough for normal usages
  100. iptables -A INPUT -p tcp --syn --dport ${SHADOWSOCKS_PORT} -m connlimit --connlimit-above 32 -j REJECT --reject-with tcp-reset
  101. ## License
  102. Copyright (C) 2013 Max Lv <max.c.lv@gmail.com>
  103. This program is free software: you can redistribute it and/or modify
  104. it under the terms of the GNU General Public License as published by
  105. the Free Software Foundation, either version 3 of the License, or
  106. (at your option) any later version.
  107. This program is distributed in the hope that it will be useful,
  108. but WITHOUT ANY WARRANTY; without even the implied warranty of
  109. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  110. GNU General Public License for more details.
  111. You should have received a copy of the GNU General Public License
  112. along with this program. If not, see <http://www.gnu.org/licenses/>.