@ -1,7 +1,7 @@
.ig
.ig
. manual page for shadowsocks-libev
. manual page for shadowsocks-libev
.
.
. Copyright (c) 2012-2015 , by: Max Lv
. Copyright (c) 2012-2016 , by: Max Lv
. All rights reserved.
. All rights reserved.
.
.
. Permission is granted to copy, distribute and/or modify this document
. Permission is granted to copy, distribute and/or modify this document
@ -25,7 +25,7 @@
.ds Ma \fBss-manager\fR
.ds Ma \fBss-manager\fR
.ds Me \fBShadowsocks-libev\fR
.ds Me \fBShadowsocks-libev\fR
.
.
.TH "SHADOWSOCKS-LIBEV" "8" "September 10, 2015 " "SHADOWSOCKS-LIBEV"
.TH "SHADOWSOCKS-LIBEV" "8" "April 19, 2016 " "SHADOWSOCKS-LIBEV"
.SH NAME
.SH NAME
shadowsocks-libev \- a lightweight and secure socks5 proxy
shadowsocks-libev \- a lightweight and secure socks5 proxy
@ -42,17 +42,18 @@ shadowsocks created by clowwindy. \*(Me is written in pure C and takes advantage
of \fBlibev\fP to achieve both high performance and low resource consumption.
of \fBlibev\fP to achieve both high performance and low resource consumption.
.PP
.PP
\*(Me consists of five components. One is \*(Se(1) that runs on a remote server
\*(Me consists of five components. One is \*(Se(1) that runs on a remote server
to provide secured tunnel service. \*(Lo(1) and \*(Re(1) are clients on your local
machines to proxy TCP traffic. \*(Tu(1) is a tool for local port forwarding.
to provide secured tunnel service. \*(Lo(1) and \*(Re(1) are clients on your
local machines to proxy TCP traffic. \*(Tu(1) is a tool for local port
forwarding.
.PP
.PP
While \*(Lo(1) works as a standard socks5 proxy, \*(Re(1) works as a transparent proxy
and requires netfilter's NAT module. For more information, check out the example
section.
While \*(Lo(1) works as a standard socks5 proxy, \*(Re(1) works as a transparent
proxy and requires netfilter's NAT module. For more information, check out the
example section.
.PP
.PP
\*(Ma(1) is a controller for multi-user management and traffic statistics, using UNIX
domain socket to talk with \*(Se(1). Also, it provides a UNIX domain socket or IP based
API for other software. About the details of this API, please refer to the protocol
section.
\*(Ma(1) is a controller for multi-user management and traffic statistics, using
UNIX domain socket to talk with \*(Se(1). Also, it provides a UNIX domain socket
or IP based API for other software. About the details of this API, please refer
to the protocol section.
.SH OPTIONS
.SH OPTIONS
.TP
.TP
@ -61,9 +62,13 @@ Set the server's hostname or IP.
.TP
.TP
.B \-p \fIserver_port\fP
.B \-p \fIserver_port\fP
Set the server's port number.
Set the server's port number.
Not available in manager mode.
.TP
.TP
.B \-l \fIlocal_port\fP
.B \-l \fIlocal_port\fP
Set the local port number.
Set the local port number.
Not available in server nor manager mode.
.TP
.TP
.B \-k \fIpassword\fP
.B \-k \fIpassword\fP
Set the password. The server and the client should use the same password.
Set the password. The server and the client should use the same password.
@ -71,26 +76,31 @@ Set the password. The server and the client should use the same password.
.B \-m \fIencrypt_method\fP
.B \-m \fIencrypt_method\fP
Set the cipher.
Set the cipher.
\*(Me accepts 18 different ciphers: table, rc4, rc4-md5,
aes-128-cfb, aes-192-cfb, aes-256-cfb, bf-cfb, camellia-128-cfb,
camellia-192-cfb, camellia-256-cfb, cast5-cfb, des-cfb, idea-cfb, rc2-cfb,
seed-cfb, salsa20, chacha20 and chacha20-ietf. The default cipher is \fItable\fP.
\*(Me accepts 18 different ciphers: table, rc4, rc4-md5, aes-128-cfb,
aes-192-cfb, aes-256-cfb, bf-cfb, camellia-128-cfb, camellia-192-cfb,
camellia-256-cfb, cast5-cfb, des-cfb, idea-cfb, rc2-cfb, seed-cfb, salsa20,
chacha20 and chacha20-ietf. The default cipher is \fItable\fP.
If built with PolarSSL or custom OpenSSL libraries, some of these ciphers may
If built with PolarSSL or custom OpenSSL libraries, some of these ciphers may
not work.
not work.
.TP
.TP
.B \-a \fIuser_name\fP
Run as a specific user.
.TP
.B \-f \fIpid_file\fP
.B \-f \fIpid_file\fP
Start shadowsocks as a daemon with specific pid file.
Start shadowsocks as a daemon with specific pid file.
.TP
.TP
.B \-t \fItimeout\fP
.B \-t \fItimeout\fP
Set the socket timeout in seconds. The default value is 1 0.
Set the socket timeout in seconds. The default value is 6 0.
.TP
.TP
.B \-c \fIconfig_file\fP
.B \-c \fIconfig_file\fP
Use a configuration file.
Use a configuration file.
.TP
.TP
.B \-n \fInofile \fP
.B \-n \fInumber \fP
Specify max number of open files.
Specify max number of open files.
Not available in manager mode.
Only available on Linux.
Only available on Linux.
.TP
.TP
.B \-i \fIinterface\fP
.B \-i \fIinterface\fP
@ -101,48 +111,55 @@ Not available in redir mode.
.B \-b \fIlocal_address\fP
.B \-b \fIlocal_address\fP
Specify local address to bind.
Specify local address to bind.
Not available in server mode.
.TP
.B \-a \fIuser_name\fP
Run as a specific user.
Not available in server nor manager mode.
.TP
.TP
.B \-u
.B \-u
Enable UDP relay.
Enable UDP relay.
TPROXY is required in redir mode.
TPROXY is required in redir mode.
.TP
.TP
.B \-U
.B \-U
Enable UDP relay and disable TCP relay.
Enable UDP relay and disable TCP relay.
Not available in local mode.
Not available in local mode.
.TP
.TP
.B \-A
.B \-A
Enable onetime authentication.
Enable onetime authentication.
.TP
.TP
.B \-w
Enable white list mode (when ACL enabled).
Only available in server mode.
.TP
.B \-L \fIaddr\fR:\fIport\fP
.B \-L \fIaddr\fR:\fIport\fP
Specify destination server address and port for local port forwarding.
Specify destination server address and port for local port forwarding.
Only available in tunnel mode.
Only available in tunnel mode.
.TP
.TP
.B \-d \fIaddr\fP
.B \-d \fIaddr\fP
Setup name servers for internal DNS resolver (libudns). The default server
is fetched from /etc/resolv.conf.
Setup name servers for internal DNS resolver (libudns). The default server is
fetched from /etc/resolv.conf.
Only available in server mode.
Only available in server and manager mode.
.TP
.TP
.B \--fast-open
.B \--fast-open
Enable TCP fast open.
Enable TCP fast open.
Only available in local and server mode, with Linux kernel > 3.7.0.
Not available in redir nor tunnel mode, with Linux kernel > 3.7.0.
.TP
.TP
.B \--acl \fIacl_config\fP
.B \--acl \fIacl_config\fP
Enable ACL (Access Control List) and specify config file.
Enable ACL (Access Control List) and specify config file.
Only available in local and server mode.
Not available in redir nor tunnel mode.
.TP
.TP
.B \--manager-address \fIpath_to_unix_domain\fP
.B \--manager-address \fIpath_to_unix_domain\fP
Specify UNIX domain socket address.
Specify UNIX domain socket address.
Only available in server and manager mode.
Only available in server and manager mode.
.TP
.TP
.B \--executable \fIpath_to_server_executable\fP
.B \--executable \fIpath_to_server_executable\fP
Specify the executable path of ss-server.
Specify the executable path of ss-server.
Only available in manager mode.
Only available in manager mode.
.TP
.TP
.B \-v
.B \-v
@ -151,8 +168,10 @@ Enable verbose mode.
.SH EXAMPLE
.SH EXAMPLE
\*(Re requires netfilter's NAT function. Here is an example:
\*(Re requires netfilter's NAT function. Here is an example:
.nf
# Create new chain
# Create new chain
root@Wrt:~# iptables -t nat -N SHADOWSOCKS
root@Wrt:~# iptables -t nat -N SHADOWSOCKS
root@Wrt:~# iptables -t mangle -N SHADOWSOCKS
# Ignore your shadowsocks server's addresses
# Ignore your shadowsocks server's addresses
# It's very IMPORTANT, just be careful.
# It's very IMPORTANT, just be careful.
@ -184,29 +203,32 @@ Enable verbose mode.
# Start the shadowsocks-redir
# Start the shadowsocks-redir
root@Wrt:~# ss-redir -u -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid
root@Wrt:~# ss-redir -u -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid
.fi
.SH PROTOCOL
.SH PROTOCOL
\*(Ma(1) provides several APIs through UDP protocol:
\*(Ma(1) provides several APIs through UDP protocol:
Send UDP commands in the following format to the manager-address provided to \*(Ma(1).
.in +4n
Send UDP commands in the following format to the manager-address provided to
\*(Ma(1).
command: [JSON data]
command: [JSON data]
To add a port:
To add a port:
add: {"server_port": 8001, "password":"7cd308cc059"}
add: {"server_port": 8001, "password":"7cd308cc059"}
To remove a port:
To remove a port:
remove: {"server_port": 8001}
remove: {"server_port": 8001}
To receive a pong:
To receive a pong:
ping
ping
Then \*(Ma(1) will send back the traffic statistics:
Then \*(Ma(1) will send back the traffic statistics:
stat: {"8001":11370}
stat: {"8001":11370}
.SH SEE ALSO
.SH SEE ALSO
.BR \*(Lo (1),
.BR \*(Lo (1),