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.

163 lines
5.3 KiB

  1. .ig
  2. . manual page for shadowsocks-libev
  3. .
  4. . Copyright (c) 2012-2016, 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 Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
  11. .
  12. . A copy of the license is included in the section entitled
  13. . "GNU Free Documentation License".
  14. .
  15. ..
  16. \# - these two are for chuckles, makes great grammar
  17. .ds Lo \fBss-local\fR
  18. .ds Re \fBss-redir\fR
  19. .ds Se \fBss-server\fR
  20. .ds Tu \fBss-tunnel\fR
  21. .ds Ma \fBss-manager\fR
  22. .ds Me \fBShadowsocks-libev\fR
  23. .
  24. .TH "SS-REDIR" "1" "April 19, 2016" "SHADOWSOCKS-LIBEV"
  25. .SH NAME
  26. ss-redir \- shadowsocks client as transparent proxy, libev port
  27. .SH SYNOPSIS
  28. \*(Re
  29. [\fB\-AuUv\fR] [\fB\-h\fR|\fB\--help\fR]
  30. [\fB\-s\fR \fIserver_host\fR] [\fB\-p\fR \fIserver_port\fR] [\fB\-l\fR \fIlocal_port\fR]
  31. [\fB\-k\fR \fIpassword\fR] [\fB\-m\fR \fIencrypt_method\fR] [\fB\-f\fR \fIpid_file\fR]
  32. [\fB\-t\fR \fItimeout\fR] [\fB\-c\fR \fIconfig_file\fR] [\fB\-b\fR \fIlocal_address\fR]
  33. [\fB\-a\fR \fIuser_name\fR] [\fB\-n\fR \fInofile\fR]
  34. .SH DESCRIPTION
  35. \*(Me is a lightweight and secure socks5 proxy. It is a port of the original
  36. shadowsocks created by clowwindy. \*(Me is written in pure C and takes advantage
  37. of \fBlibev\fP to achieve both high performance and low resource consumption.
  38. .PP
  39. \*(Me consists of five components. \*(Re(1) works as a transparent proxy on
  40. local machines to proxy TCP traffic and requires netfilter's NAT module. For
  41. more information, check out \fBshadowsocks-libev\fR(8) and the following
  42. \fBEXAMPLE\fR section.
  43. .SH OPTIONS
  44. .TP
  45. .B \-s \fIserver_host\fP
  46. Set the server's hostname or IP.
  47. .TP
  48. .B \-p \fIserver_port\fP
  49. Set the server's port number.
  50. .TP
  51. .B \-l \fIlocal_port\fP
  52. Set the local port number.
  53. .TP
  54. .B \-k \fIpassword\fP
  55. Set the password. The server and the client should use the same password.
  56. .TP
  57. .B \-m \fIencrypt_method\fP
  58. Set the cipher.
  59. \*(Me accepts 18 different ciphers: table, rc4, rc4-md5, aes-128-cfb,
  60. aes-192-cfb, aes-256-cfb, bf-cfb, camellia-128-cfb, camellia-192-cfb,
  61. camellia-256-cfb, cast5-cfb, des-cfb, idea-cfb, rc2-cfb, seed-cfb, salsa20,
  62. chacha20 and chacha20-ietf. The default cipher is \fItable\fP.
  63. If built with PolarSSL or custom OpenSSL libraries, some of these ciphers may
  64. not work.
  65. .TP
  66. .B \-a \fIuser_name\fP
  67. Run as a specific user.
  68. .TP
  69. .B \-f \fIpid_file\fP
  70. Start shadowsocks as a daemon with specific pid file.
  71. .TP
  72. .B \-t \fItimeout\fP
  73. Set the socket timeout in seconds. The default value is 60.
  74. .TP
  75. .B \-c \fIconfig_file\fP
  76. Use a configuration file.
  77. .TP
  78. .B \-n \fInumber\fP
  79. Specify max number of open files.
  80. Only available on Linux.
  81. .TP
  82. .B \-b \fIlocal_address\fP
  83. Specify local address to bind.
  84. .TP
  85. .B \-u
  86. Enable UDP relay.
  87. TPROXY is required in redir mode. You may need root permission.
  88. .TP
  89. .B \-U
  90. Enable UDP relay and disable TCP relay.
  91. .TP
  92. .B \-A
  93. Enable onetime authentication.
  94. .TP
  95. .B \-v
  96. Enable verbose mode.
  97. .TP
  98. .B \-h, --help
  99. Print help message.
  100. .SH EXAMPLE
  101. \*(Re requires netfilter's NAT function. Here is an example:
  102. .nf
  103. # Create new chain
  104. root@Wrt:~# iptables -t nat -N SHADOWSOCKS
  105. # Ignore your shadowsocks server's addresses
  106. # It's very IMPORTANT, just be careful.
  107. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 123.123.123.123 -j RETURN
  108. # Ignore LANs and any other addresses you'd like to bypass the proxy
  109. # See Wikipedia and RFC5735 for full list of reserved networks.
  110. # See ashi009/bestroutetb for a highly optimized CHN route list.
  111. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
  112. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN
  113. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 127.0.0.0/8 -j RETURN
  114. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 169.254.0.0/16 -j RETURN
  115. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 172.16.0.0/12 -j RETURN
  116. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 192.168.0.0/16 -j RETURN
  117. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 224.0.0.0/4 -j RETURN
  118. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -d 240.0.0.0/4 -j RETURN
  119. # Anything else should be redirected to shadowsocks's local port
  120. root@Wrt:~# iptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 12345
  121. # Add any UDP rules
  122. root@Wrt:~# ip rule add fwmark 0x01/0x01 table 100
  123. root@Wrt:~# ip route add local 0.0.0.0/0 dev lo table 100
  124. root@Wrt:~# iptables -t mangle -A SHADOWSOCKS -p udp --dport 53 -j TPROXY --on-port 12345 --tproxy-mark 0x01/0x01
  125. # Apply the rules
  126. root@Wrt:~# iptables -t nat -A PREROUTING -p tcp -j SHADOWSOCKS
  127. root@Wrt:~# iptables -t mangle -A PREROUTING -j SHADOWSOCKS
  128. # Start the shadowsocks-redir
  129. root@Wrt:~# ss-redir -u -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid
  130. .fi
  131. .SH SEE ALSO
  132. .BR \*(Lo (1),
  133. .BR \*(Se (1),
  134. .BR \*(Tu (1),
  135. .BR \*(Ma (1),
  136. .BR shadowsocks-libev (8),
  137. .BR iptables (8),
  138. /etc/shadowsocks-libev/config.json
  139. .br
  140. .SH AUTHOR
  141. shadowsocks was created by clowwindy <clowwindy42@gmail.com> and
  142. shadowsocks-libev was maintained by Max Lv <max.c.lv@gmail.com> and Linus Yang
  143. <laokongzi@gmail.com>.
  144. .PP
  145. This manual page was written by Max Lv <max.c.lv@gmail.com>.
  146. .PP
  147. The manual pages were rearranged by hosiet <073plan@gmail.com>.