Skip to content

[Feature Request] One sslocal instance to handle multi-proxies, each of which can use dedicated ssservers #1978

@robot-dot-win

Description

@robot-dot-win

shadowsocks-rust is so powerful that it’s completely suitable for enterprise use. In fact my company is using it in several scenarios, one of which is to act as proxies of the outgoing SMTP server. For the cost reason, the company does not use a commercial email service but is running its own business email server to handle communications with its suppliers and customers all over the world. As you know, IP addresses from certain regions are usually blocked by some other regions, so I have to set up several ssservers in different regions - USA, Germany, Singapore and locally, and each configuration is like:

{
    "servers": [
        {
            "acl": "/etc/ss/sss.acl",
            "server": "0.0.0.0",
            "server_port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        }
    ]
}

On the email server I set up several sslocal instances as transparent proxies, each of which uses certain ssservers:

// local transparent proxy No.1 - dedicated to North America:
{
    "locals": [
        {
            "local_address": "127.0.0.1",
            "local_port": 8301,
            "protocol": "redir",
            "tcp_redir": "redirect"
        }
    ],

    "servers": [
        {
            "tcp_weight": 1.0,
            "address": "IP_in_USA",
            "port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        },
        {
            "tcp_weight": 0.8,
            "address": "IP_in_Germany",
            "port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        }
    ]
}

// local transparent proxy No.2 - dedicated to Asia Pacific and Africa:
{
    "locals": [
        {
            "local_address": "127.0.0.1",
            "local_port": 8302,
            "protocol": "redir",
            "tcp_redir": "redirect"
        }
    ],

    "servers": [
        {
            "tcp_weight": 1.0,
            "address": "IP_Locally",
            "port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        },
        {
            "tcp_weight": 0.8,
            "address": "IP_in_Singapore",
            "port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        }
    ]
}

// local transparent proxy No.3 - dedicated to Europe:
{
    "locals": [
        {
            "local_address": "127.0.0.1",
            "local_port": 8303,
            "protocol": "redir",
            "tcp_redir": "redirect"
        }
    ],

    "servers": [
        {
            "tcp_weight": 1.0,
            "address": "IP_in_Germany",
            "port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        },
        {
            "tcp_weight": 0.8,
            "address": "IP_in_Singapore",
            "port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        }
    ]
}

As you can see, I have to run individual sslocal instance for different group of ssservers. Now I hope to run only one sslocal instance to handle multi-proxies, each of which has dedicated ssservers. The sole configuration might like:

{
    "locals": [
        {
            "local_address": "127.0.0.1",
            "local_port": 8301,
            "protocol": "redir",
            "tcp_redir": "redirect",
            "remotes":
            {
               "USA":1.0,
               "Germany":0.8
            }
        },
        {
            "local_address": "127.0.0.1",
            "local_port": 8302,
            "protocol": "redir",
            "tcp_redir": "redirect",
            "remotes":
            {
                "Locally":1.0,
                "Singapore":0.8
            }
       },
       {
            "local_address": "127.0.0.1",
            "local_port": 8303,
            "protocol": "redir",
            "tcp_redir": "redirect",
            "remotes":
            {
                "Germany":1.0,
                "Singapore":0.8
            }
      }
    ],

    "servers": [
        {
            "name": "Locally",
            "address": "IP_Locally",
            "port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        },
        {
            "name": "USA",
            "address": "IP_in_USA",
            "port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        },
        {
            "name": "Singapore",
            "address": "IP_in_Singapore",
            "port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        },
        {
            "name": "Germany",
            "address": "IP_in_Germany",
            "port": 8443,
            "method": "aes-256-gcm",
            "password": "Password@Port:8443"
        }
    ]
}

I believe all enterprise users would appreciate this feature very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions