Expand description

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

Balancer Config

Configuration

Configuration parsing error

Error type for RedirType’s FromStr::Err

Local server configuration

Configuration for Manager

Parsing ManagerServerMode error

Error while parsing ProtocolType from string

Security Config

Enums

Server config type

Configuration parsing error kind

Host for servers to bind

Mode of Manager’s server

Protocol of local server

Transparent Proxy type

Functions

Parse variable value if it is an environment variable