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.

97 lines
3.3 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
12 years ago
11 years ago
12 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
11 years ago
11 years ago
12 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.0 [![Build Status](https://travis-ci.org/madeye/shadowsocks-libev.png?branch=master)](https://travis-ci.org/madeye/shadowsocks-libev)
  11. Features
  12. --------
  13. Shadowsocks-libev is writen in pure C and only depends on
  14. [libev](http://software.schmorp.de/pkg/libev.html).
  15. When statically linked and packaged for OpenWRT, the total package size is 23KB.
  16. In normal usage, the memory consumption is about 600KB and the CPU utilization is
  17. no more than 5% on a low-end router (Buffalo WHR-G300N V2 with a 400MHz MIPS CPU,
  18. 32MB memory and 4MB flash).
  19. Installation
  20. ------------
  21. Build the binary like this:
  22. ```bash
  23. sudo apt-get install build-essential autoconf libtool
  24. ./configure && make
  25. sudo make install
  26. ```
  27. Usage
  28. -----
  29. ```
  30. usage:
  31. ss-local -s server_host -p server_port -l local_port -k password
  32. [-m encrypt_method] [-f pid_file] [-t timeout] [-c config_file]
  33. ss-redir -s server_host -p server_port -l local_port -k password
  34. [-m encrypt_method] [-f pid_file] [-t timeout] [-c config_file]
  35. ss-server -s server_host -p server_port -k password
  36. [-m encrypt_method] [-f pid_file] [-t timeout] [-c config_file]
  37. options:
  38. encrypt_method: table, rc4
  39. pid_file: valid path to the pid file
  40. timeout: socket timeout in senconds
  41. config_file: json format config file
  42. notes:
  43. ss-redir provides a transparent proxy function and only works on the
  44. Linux platform with iptables.
  45. ```
  46. ## Advanced usage
  47. The latest shadowsocks-libev has provided a transparent mode. You can configure your linux based box or router to proxy all tcp traffic transparently.
  48. # Create new chain
  49. root@Wrt:~# iptables -t nat -N SHADOWSOCKS
  50. # Ignore your shadowsocks server's addresses
  51. # It's very IMPORTANT, just be careful.
  52. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 123.123.123.123 -j RETURN
  53. # Ignore LANs and any other addresses you'd like to bypass the proxy
  54. # See Wikipedia and RFC5735 for full list of reserved networks.
  55. # See ashi009/bestroutetb for a highly optimized CHN route list.
  56. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
  57. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN
  58. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 127.0.0.0/8 -j RETURN
  59. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 169.254.0.0/16 -j RETURN
  60. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 172.16.0.0/12 -j RETURN
  61. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 192.168.0.0/16 -j RETURN
  62. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 224.0.0.0/4 -j RETURN
  63. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 240.0.0.0/4 -j RETURN
  64. # Anything else should be redirected to shadowsocks's local port
  65. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 12345
  66. # Apply the rules
  67. root@Wrt:~# iptables -t nat -A OUTPUT -p tcp -j SHADOWSOCKS
  68. # Start the shadowsocks-redir
  69. root@Wrt:~# ss-redir -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid