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.

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