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.

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