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.

166 lines
5.8 KiB

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