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.

186 lines
6.0 KiB

11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
10 years ago
10 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
11 years ago
10 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
10 years ago
11 years ago
  1. .ig
  2. . manual page for shadowsocks-libev
  3. .
  4. . Copyright (c) 2012-2015, by: Max Lv
  5. . All rights reserved.
  6. .
  7. . Permission is granted to copy, distribute and/or modify this document
  8. . under the terms of the GNU Free Documentation License, Version 1.1 or
  9. . any later version published by the Free Software Foundation;
  10. . with no Front-Cover Texts, no Back-Cover Texts, and with the following
  11. . Invariant Sections (and any sub-sections therein):
  12. . all .ig sections, including this one
  13. . STUPID TRICKS Sampler
  14. . AUTHOR
  15. .
  16. . A copy of the Free Documentation License is included in the section
  17. . entitled "GNU Free Documentation License".
  18. .
  19. ..
  20. \# - these two are for chuckles, makes great grammar
  21. .ds Lo \fBss-local\fR
  22. .ds Re \fBss-redir\fR
  23. .ds Se \fBss-server\fR
  24. .ds Tu \fBss-tunnel\fR
  25. .ds Ma \fBss-manager\fR
  26. .ds Me \fBShadowsocks\fR
  27. .TH SHADOWSOCKS-LIBEV 8 "January 7, 2015"
  28. .SH NAME
  29. shadowsocks-libev \- a lightweight and secure socks5 proxy
  30. .SH SYNOPSIS
  31. \*(Lo|\*(Re|\*(Se|\*(Tu|\*(Ma
  32. \-s server_host \-p server_port
  33. \-l local_port \-k password
  34. \-m encrypt_method \-f pid_file
  35. \-t timeout \-c config_file
  36. .SH DESCRIPTION
  37. \*(Me is a lightweight and secure socks5 proxy. It is a port of the original
  38. shadowsocks created by clowwindy. \*(Me is written in pure C and takes advantage
  39. of \fBlibev\fP to achieve both high performance and low resource consumption.
  40. .PP
  41. \*(Me consists of four components. One is \*(Se that runs on a remote server
  42. to provide secured tunnel service. \*(Lo and \*(Re are clients on your local
  43. machines to proxy TCP traffic. \*(Tu is a tool for local port forwarding.
  44. .PP
  45. While \*(Lo works as a standard socks5 proxy, \*(Re works as a transparent proxy
  46. and requires netfilter's NAT module. For more information, check out the example
  47. section.
  48. .PP
  49. \*(Ma is a controller for multi-user management and traffic statistics, using UNIX
  50. domain socket to talk with \*(Se. Also, it provides a UNIX domain socket or IP based
  51. API for other software. About the details of this API, please refer to the protocol
  52. section.
  53. .SH OPTIONS
  54. .TP
  55. .B \-s \fIserver_host\fP
  56. Set the server's hostname or IP.
  57. .TP
  58. .B \-p \fIserver_port\fP
  59. Set the server's port number.
  60. .TP
  61. .B \-l \fIlocal_port\fP
  62. Set the local port number.
  63. .TP
  64. .B \-k \fIpassword\fP
  65. Set the password. The server and the client should use the same password.
  66. .TP
  67. .B \-m \fIencrypt_method\fP
  68. Set the cipher. Shadowsocks accepts 16 different ciphers: table, rc4, rc4-md5,
  69. aes-128-cfb, aes-192-cfb, aes-256-cfb, bf-cfb, camellia-128-cfb,
  70. camellia-192-cfb, camellia-256-cfb, cast5-cfb, des-cfb, idea-cfb, rc2-cfb,
  71. seed-cfb, salsa20 and chacha20. The default cipher is \fItable\fP. If
  72. built with PolarSSL or custom OpenSSL libraries, some of these ciphers may
  73. not work.
  74. .TP
  75. .B \-f \fIpid_file\fP
  76. Start shadowsocks as a daemon with specific pid file.
  77. .TP
  78. .B \-t \fItimeout\fP
  79. Set the socket timeout in seconds. The default value is 10.
  80. .TP
  81. .B \-c \fIconfig_file\fP
  82. Use a configuration file.
  83. .TP
  84. .B \-a \fIuser_name\fP
  85. Run as a specific user.
  86. .TP
  87. .B \-d \fIaddr\fP
  88. Setup the name servers for libudns. The default server is fetched from
  89. /etc/resolv.conf.
  90. .TP
  91. .B \-u
  92. Enable UDP relay.
  93. .TP
  94. .B \-A
  95. Enable onetime authentication.
  96. .TP
  97. .B \-v
  98. Enable verbose mode.
  99. .TP
  100. .B \--fast-open
  101. Enable TCP fast open.
  102. .TP
  103. .B \--acl \fIacl_config\fP
  104. Enable ACL (Access Control List).
  105. .TP
  106. .B \--manager-address \fIpath_to_unix_domain\fP
  107. Enable manager mode.
  108. .TP
  109. .B \--executable \fIpath_to_server_executable\fP
  110. Specify the executable path of ss-server for manager mode.
  111. .SH EXAMPLE
  112. \*(Re requires netfilter's NAT function. Here is an example:
  113. # Create new chain
  114. root@Wrt:~# iptables -t nat -N SHADOWSOCKS
  115. # Ignore your shadowsocks server's addresses
  116. # It's very IMPORTANT, just be careful.
  117. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 123.123.123.123 -j RETURN
  118. # Ignore LANs and any other addresses you'd like to bypass the proxy
  119. # See Wikipedia and RFC5735 for full list of reserved networks.
  120. # See ashi009/bestroutetb for a highly optimized CHN route list.
  121. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
  122. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN
  123. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 127.0.0.0/8 -j RETURN
  124. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 169.254.0.0/16 -j RETURN
  125. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 172.16.0.0/12 -j RETURN
  126. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 192.168.0.0/16 -j RETURN
  127. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 224.0.0.0/4 -j RETURN
  128. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 240.0.0.0/4 -j RETURN
  129. # Anything else should be redirected to shadowsocks's local port
  130. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 12345
  131. # Add any UDP rules
  132. root@Wrt:~# ip rule add fwmark 0x01/0x01 table 100
  133. root@Wrt:~# ip route add local 0.0.0.0/0 dev lo table 100
  134. root@Wrt:~# iptables -t mangle -A SHADOWSOCKS -p udp --dport 53 -j TPROXY --on-port 12345 --tproxy-mark 0x01/0x01
  135. # Apply the rules
  136. root@Wrt:~# iptables -t nat -A PREROUTING -p tcp -j SHADOWSOCKS
  137. root@Wrt:~# iptables -t mangle -A PREROUTING -j SHADOWSOCKS
  138. # Start the shadowsocks-redir
  139. root@Wrt:~# ss-redir -u -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid
  140. .SH PROTOCOL
  141. \*(Ma provides several APIs through UDP protocol:
  142. Send UDP commands in the following format to the manager-address provided to \*(Ma.
  143. command: [JSON data]
  144. To add a port:
  145. add: {"server_port": 8001, "password":"7cd308cc059"}
  146. To remove a port:
  147. remove: {"server_port": 8001}
  148. To receive a pong:
  149. ping
  150. Then \*(Ma will send back the traffic statistics:
  151. stat: {"8001":11370}
  152. .SH SEE ALSO
  153. .BR iptables (8),
  154. /etc/shadowsocks-libev/config.json
  155. .br
  156. .SH AUTHOR
  157. shadowsocks was created by clowwindy <clowwindy42@gmail.com> and
  158. shadowsocks-libev was maintained by Max Lv <max.c.lv@gmail.com> and Linus Yang
  159. <laokongzi@gmail.com>.
  160. .PP
  161. This manual page was written by Max Lv <max.c.lv@gmail.com>.