mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-21 22:43:48 +00:00
193 lines
5.9 KiB
Plaintext
193 lines
5.9 KiB
Plaintext
ss-manager(1)
|
|
=============
|
|
|
|
NAME
|
|
----
|
|
ss-manager - ss-server controller for multi-user management and traffic statistics
|
|
|
|
SYNOPSIS
|
|
--------
|
|
// Generated by scripts/gen_cli_docs.py from src/manager.c; do not edit this section.
|
|
|
|
*ss-manager* [-f <pid_file>] [-s <server_host>] [-l <local_port>] [-k
|
|
<password>] [-t <timeout>] [-m <encrypt_method>] [-c <config_file>] [-i
|
|
<interface>] [-d <addr>] [-a <user_name>] [-n <number>] [-D <path>] [-6] [-h]
|
|
[-u] [-U] [-v] [-A] [--fast-open] [--no-delay] [--reuse-port] [--acl
|
|
<acl_config>] [--manager-address <address>] [--executable <path>] [--mtu
|
|
<MTU>] [--plugin <plugin_name>] [--plugin-opts <plugin_options>] [--password
|
|
<password>] [--workdir <path>] [--help]
|
|
|
|
DESCRIPTION
|
|
-----------
|
|
*shadowsocks-c* is a lightweight and secure socks5 proxy.
|
|
It is a port of the original shadowsocks created by clowwindy.
|
|
*shadowsocks-c* is written in pure C and takes advantage of libuv to
|
|
achieve both high performance and low resource consumption.
|
|
|
|
*shadowsocks-c* consists of five components.
|
|
`ss-manager`(1) is a controller for multi-user management and
|
|
traffic statistics, using UNIX domain socket to talk with `ss-server`(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 following 'PROTOCOL'
|
|
section.
|
|
|
|
OPTIONS
|
|
-------
|
|
// Generated by scripts/gen_cli_docs.py from src/manager.c; do not edit this section.
|
|
|
|
This section lists options across supported builds. Platform and feature
|
|
restrictions are noted below; not every option is effective on every platform.
|
|
|
|
-f <pid_file>::
|
|
Start shadowsocks as a daemon with specific pid file.
|
|
|
|
-s <server_host>::
|
|
Set a server listening hostname or IP address. May be repeated.
|
|
|
|
-l <local_port>::
|
|
Accepted for compatibility but ignored by this program; it does not configure a local listener.
|
|
|
|
-k <password>::
|
|
Set the password. The server and the client should use the same password.
|
|
|
|
-t <timeout>::
|
|
Set the socket timeout in seconds. The default value is 60.
|
|
|
|
-m <encrypt_method>::
|
|
Set the cipher. The default is 'chacha20-ietf-poly1305'.
|
|
+
|
|
AEAD cipher names from the source (availability depends on the build):
|
|
aes-128-gcm, aes-192-gcm, aes-256-gcm, 2022-blake3-aes-128-gcm, 2022-blake3-aes-256-gcm, chacha20-ietf-poly1305, 2022-blake3-chacha20-poly1305, xchacha20-ietf-poly1305.
|
|
+
|
|
Legacy stream cipher names recognized by the source (disabled in minimal builds;
|
|
some require backend support): table, rc4, rc4-md5, aes-128-cfb, aes-192-cfb, aes-256-cfb, aes-128-ctr, aes-192-ctr, aes-256-ctr, bf-cfb, camellia-128-cfb, camellia-192-cfb, camellia-256-cfb, cast5-cfb, des-cfb, idea-cfb, rc2-cfb, seed-cfb, salsa20, chacha20, chacha20-ietf.
|
|
+
|
|
The '2022-blake3-*' ciphers implement Shadowsocks 2022 (SIP022). They require
|
|
a base64-encoded pre-shared key supplied with *-k*: 16 bytes for
|
|
2022-blake3-aes-128-gcm and 32 bytes for the other 2022 ciphers.
|
|
Generate a 32-byte key with `openssl rand -base64 32`.
|
|
Passwords are not stretched into keys for these ciphers.
|
|
|
|
-c <config_file>::
|
|
Use a JSON configuration file. The "port_password" field can start multiple ss-server instances.
|
|
|
|
-i <interface>::
|
|
Send outbound traffic through the specified network interface where supported by the platform.
|
|
|
|
-d <addr>::
|
|
Configure name servers for the internal c-ares DNS resolver. By default it uses the system resolver configuration.
|
|
|
|
-a <user_name>::
|
|
Run as a specific user.
|
|
|
|
-n <number>::
|
|
Specify the maximum number of open files. Requires a platform with setrlimit support.
|
|
|
|
-D <path>::
|
|
Set the working directory of ss-manager.
|
|
|
|
-6::
|
|
Resolve hostname to IPv6 address first.
|
|
|
|
-h::
|
|
Print help message.
|
|
|
|
-u::
|
|
Enable UDP relay.
|
|
|
|
-U::
|
|
Enable UDP relay and disable TCP relay.
|
|
|
|
-v::
|
|
Enable verbose mode.
|
|
|
|
-A::
|
|
Deprecated one-time authentication option. Exits with an error; use AEAD ciphers instead.
|
|
|
|
--fast-open::
|
|
Enable TCP Fast Open where supported by the operating system.
|
|
|
|
--no-delay::
|
|
Enable TCP_NODELAY.
|
|
|
|
--reuse-port::
|
|
Enable port reuse where supported by the operating system.
|
|
|
|
--acl <acl_config>::
|
|
Enable ACL (Access Control List) and specify config file.
|
|
|
|
--manager-address <address>::
|
|
Set the manager control address: a UNIX domain socket path or an IP address and port.
|
|
|
|
--executable <path>::
|
|
Set the executable path of ss-server used by ss-manager.
|
|
|
|
--mtu <MTU>::
|
|
Specify the MTU of your network interface.
|
|
|
|
--plugin <plugin_name>::
|
|
Enable SIP003 plugin. (Experimental)
|
|
|
|
--plugin-opts <plugin_options>::
|
|
Set SIP003 plugin options. (Experimental)
|
|
|
|
--password <password>::
|
|
Set the password. The server and the client should use the same password.
|
|
|
|
--workdir <path>::
|
|
Set the working directory of ss-manager (alias for *-D*).
|
|
|
|
--help::
|
|
Print help message.
|
|
|
|
PROTOCOL
|
|
--------
|
|
`ss-manager`(1) provides several APIs through UDP protocol:
|
|
|
|
Send UDP commands in the following format to the manager-address provided to ss-manager(1): ::::
|
|
command: [JSON data]
|
|
|
|
To add a port: ::::
|
|
add: {"server_port": 8001, "password":"7cd308cc059"}
|
|
|
|
To remove a port: ::::
|
|
remove: {"server_port": 8001}
|
|
|
|
To receive the traffic statistics: ::::
|
|
ping
|
|
|
|
The format of the traffic statistics: ::::
|
|
stat: {"8001":11370}
|
|
|
|
There is no way to reset the traffic statistics, unless you remove the port and add it again
|
|
|
|
EXAMPLE
|
|
-------
|
|
To use `ss-manager`(1), First start it and specify necessary information.
|
|
|
|
Then communicate with `ss-manager`(1) through UNIX Domain Socket using UDP
|
|
protocol:
|
|
|
|
....
|
|
# Start the manager. Arguments for ss-server will be passed to generated
|
|
# ss-server process(es) respectively.
|
|
ss-manager --manager-address /tmp/manager.sock --executable $(which ss-server) -s example.com -m aes-256-cfb -c /path/to/config.json
|
|
|
|
# Connect to the socket. Using netcat-openbsd as an example.
|
|
# You should use scripts or other programs for further management.
|
|
nc -Uu /tmp/manager.sock
|
|
....
|
|
|
|
After that, you may communicate with `ss-manager`(1) as described above in the
|
|
'PROTOCOL' section.
|
|
|
|
SEE ALSO
|
|
--------
|
|
`ss-local`(1),
|
|
`ss-server`(1),
|
|
`ss-tunnel`(1),
|
|
`ss-redir`(1),
|
|
`shadowsocks-libev`(8),
|
|
`iptables`(8),
|
|
/etc/shadowsocks-libev/config.json
|