Managing Multiple Users with Shadowsocks Manager

It supports ACL (Access Control List) and HTTP/HTTPS Proxy protocol, which means you can restrict access to certain IP addresses or use it as a proxy server for web browsing.

To get started with Shadowsocks Manager, first download the latest version from their website and extract the files. Then open up your terminal (or command prompt if you’re on Windows) and navigate to the extracted folder. From there, run `ssmanager` followed by any options or configuration file paths that you want to use.

For example:

#!/bin/bash

# This script is used to start the Shadowsocks Manager with various options and configuration files.

# First, download the latest version from the Shadowsocks website and extract the files.

# Then, open up your terminal (or command prompt if you're on Windows) and navigate to the extracted folder.

# From there, run `ssmanager` followed by any options or configuration file paths that you want to use.

# For example:

# Start the Shadowsocks Manager with the `--manager-address` command line parameter, specifying the IP address and port to listen on.
ssmanager --manager-address "127.0.0.1:6100"

# For *nix systems, the manager can also bind to a Unix socket address.
ssmanager --manager-address "/tmp/shadowsocks-manager.sock"

# You can also provide a configuration file using the `-c` flag.
# The `manager_address` key must be provided in the configuration file.
ssmanager -c /path/to/shadowsocks.json

Once Shadowsocks Manager is running, you can add or remove servers using the API that it supports:

– `add` Starts a server instance
– `remove` Deletes an existing server instance
– `list` Lists all current running servers
– `ping` Lists all servers’ statistic data

NOTE: The `stat` command is not supported because the servers are running in the same process with the manager itself.

To add a new server, you can use the following format:

{
    // Required options
    // Address that ssmanager is listening on
    "manager_address": "127.0.0.1", // Specifies the IP address for the manager to listen on
    "manager_port": 6100, // Specifies the port for the manager to listen on

    // Or bind to a Unix Domain Socket
    "manager_address": "/tmp/shadowsocks-manager.sock", // Specifies the Unix Domain Socket for the manager to bind to

    "servers": [
        // These servers will be started automatically when ssmanager is started
    ],

    // Outbound socket binds to this IP address
    // For choosing different network interface on the same machine
    "local_address": "xxx.xxx.xxx.xxx", // Specifies the IP address for the outbound socket to bind to, allowing for selection of a specific network interface on the same machine

    // Other options that may be passed directly to new servers
}

You can customize your server configuration by adding or removing certain parameters, such as `server_port`, `password`, and `cipher`. For example:

{
    "servers": [ // An array of server configurations
        {
            "server_address": "xxx.xxx.xxx.xxx", // The IP address of Server 1
            "server_port": 8388, // The port number for Server 1
            "password": "hello-kitty" // The password for Server 1
        },
        {
            "server_address": "yyy.yyy.yyy.yyy", // The IP address of Server 2
            "server_port": 9150, // The port number for Server 2
            "password": "secret-code", // The password for Server 2
            "method": "aes-256-gcm" // The encryption method for Server 2
        }
    ]
}

In this example, we have two servers with different configurations. The first server uses the default cipher (AES-128-CBC) and password (“hello-kitty”), while the second server uses a stronger cipher (AES-256-GCM) and a more secure password (“secret-code”).

To remove a server, you can use the following format:

{
    "servers": [
        {
            // Server 1 configuration
            "server_address": "xxx.xxx.xxx.xxx", // Specifies the IP address of the first server
            "server_port": 8388, // Specifies the port number of the first server
            "password": "hello-kitty" // Specifies the password for the first server
        },
        {
            // Server 2 configuration (to be removed)
            "server_address": "yyy.yyy.yyy.yyy", // Specifies the IP address of the second server
            "server_port": 9150, // Specifies the port number of the second server
            "password": "secret-code", // Specifies the password for the second server
            "method": "aes-256-gcm" // Specifies the encryption method for the second server
        }
    ]
}

// The "servers" array contains the configurations for multiple servers
// Each server configuration is enclosed in curly braces {}
// The "//" symbol indicates a comment, providing additional information about the code
// The "server_address" key specifies the IP address of the server
// The "server_port" key specifies the port number of the server
// The "password" key specifies the password for the server
// The "method" key specifies the encryption method for the server

In this example, we have two servers with different configurations. The first server is still active and will continue to run when Shadowsocks Manager starts up. However, the second server (with a `server_port` of 9150) has been removed from the configuration file using the `remove` command.

To list all running servers or get statistics data for each one, you can use the following format:

# This script is used to list all current running servers and get statistics data for a specific server using Shadowsocks Manager.

# List all current running servers
ssmanager list # This command lists all the currently running servers.

# Get statistic data for a specific server (server_port 8388)
echo 'ping: {"server_port":8388}' | nc -Uu '/tmp/shadowsocks-manager.sock' # This command sends a request to the Shadowsocks Manager socket to get statistics data for the server with a server_port of 8388. The response will be displayed in the terminal.

In this example, we first list all running servers using the `list` command. This will display a table with information about each server, such as its IP address, port number, and status (running or stopped). If you want to get more detailed statistics data for a specific server, you can use the `ping` command followed by the server’s configuration parameters in JSON format.

Overall, Shadowsocks Manager is an incredibly powerful tool that allows you to easily manage multiple servers with different configurations and access control lists. Whether you need it for web browsing or secure communication over a VPN, this software has got you covered!

SICORPS