Module shadowsocks_service::config[][src]

This is a mod for storing and parsing configuration

According to shadowsocks’ official documentation, the standard configuration file should be in JSON format:

{
    "server": "127.0.0.1",
    "server_port": 1080,
    "local_port": 8388,
    "password": "the-password",
    "timeout": 300,
    "method": "aes-256-cfb",
    "local_address": "127.0.0.1"
}

But this configuration is not for using multiple shadowsocks server, so we introduce an extended configuration file format:

{
    "servers": [
        {
            "server": "127.0.0.1",
            "server_port": 1080,
            "password": "hellofuck",
            "method": "bf-cfb"
        },
        {
            "server": "127.0.0.1",
            "server_port": 1081,
            "password": "hellofuck",
            "method": "aes-128-cfb"
        }
    ],
    "local_port": 8388,
    "local_address": "127.0.0.1"
}

These defined server will be used with a load balancing algorithm.

Structs

Config

Configuration

Error

Configuration parsing error

LocalConfig

Local server configuration

ManagerConfig

Configuration for Manager

ProtocolTypeError

Error while parsing ProtocolType from string

Enums

ConfigType

Server config type

DnsConfig
ErrorKind

Configuration parsing error kind

ManagerServerHost

Host for servers to bind

ProtocolType

Protocol of local server