v2fly / v2ray-examples

v2ray-core 的模板们
2.35k stars 740 forks source link

VLESS over TCP with TLS + 回落 & 分流 to WebSocket(进阶配置) 方案多用户配置问题 #63

Closed GeorgeRudd closed 3 years ago

GeorgeRudd commented 3 years ago

请问这种方案如何配置多用户?我根据模板配置了一下没成功。 我创建了两个用户,"email“:a和"email“:b。 "email“:a id为 40d3d26c-bf99-40c8-938d-8189d6e0ad5d "email“:b id为 40d3d26c-bf99-40c8-938d-8189d6e0ad5e 这是我尝试的第一种配置

{
    "log": {
        "loglevel": "warning"
    },
    "inbounds": [
        {
            "port": 443,
            "protocol": "vless",
            "settings": {
                "clients": [
                    {
                        "id": "40d3d26c-bf99-40c8-938d-8189d6e0ad5d",
                        "level": 0,
                        "email": "a"
                    },
            {
                        "email": "b",
                        "id": "40d3d26c-bf99-40c8-938d-8189d6e0ad5e",
                        "level": 0
                    }
                ],
                "decryption": "none",
                "fallbacks": [
                    {
                        "dest": 80
                    },
                    {
                        "path": "/z000",
                        "dest": 1234,
                        "xver": 1
                    },
                    {
                        "path": "/z001",
                        "dest": 1235,
                        "xver": 1
                    }
                ]
            },                  
                ]
            },
            "streamSettings": {
                "network": "tcp",
                "security": "tls",
                "tlsSettings": {
                    "alpn": [
                        "http/1.1"
                    ],
                    "certificates": [
                        {
                            "certificateFile": "/home/cert.pem",
                            "keyFile": "/home/key.pem"
                        }
                    ]
                }
            }
        },
        {
            "port": 1234,
            "listen": "127.0.0.1",
            "protocol": "vless",
            "settings": {
                "clients": [
                    {
                        "id": "40d3d26c-bf99-40c8-938d-8189d6e0ad5d",
                        "level": 0,
                        "email": "a"
                    }
                ],
                "decryption": "none"
            },
            "streamSettings": {
                "network": "ws",
                "security": "none",
                "wsSettings": {
                    "acceptProxyProtocol": true,
                    "path": "/z000"
                }
            }
        },
        {
            "port": 1235,
            "listen": "127.0.0.1",
            "protocol": "vless",
            "settings": {
                "clients": [
                    {
                        "id": "40d3d26c-bf99-40c8-938d-8189d6e0ad5e",
                        "level": 0,
                        "email": "b"
                    }
                ],
                "decryption": "none"
            },
            "streamSettings": {
                "network": "ws",
                "security": "none",
                "wsSettings": {
                    "acceptProxyProtocol": true,
                    "path": "/z001"
                }
            }
        }       
    ],
    "outbounds": [
        {
            "protocol": "freedom"
        }
    ]
}

这是我尝试的第二种配置

{
    "log": {
        "loglevel": "warning"
    },
    "inbounds": [
        {
            "port": 443,
            "protocol": "vless",
            "settings": {
                "clients": [
                    {
                        "id": "40d3d26c-bf99-40c8-938d-8189d6e0ad5d",
                        "level": 0,
                        "email": "a"
                    },
            {
                        "email": "b",
                        "id": "40d3d26c-bf99-40c8-938d-8189d6e0ad5e",
                        "level": 0
                    }
                ],
                "decryption": "none",
                "fallbacks": [
                    {
                        "dest": 80
                    },
                    {
                        "path": "/z000",
                        "dest": 1234,
                        "xver": 1
                    }
                ]
            },                  
                ]
            },
            "streamSettings": {
                "network": "tcp",
                "security": "tls",
                "tlsSettings": {
                    "alpn": [
                        "http/1.1"
                    ],
                    "certificates": [
                        {
                            "certificateFile": "/home/cert.pem",
                            "keyFile": "/home/key.pem"
                        }
                    ]
                }
            }
        },
        {
            "port": 1234,
            "listen": "127.0.0.1",
            "protocol": "vless",
            "settings": {
                "clients": [
                    {
                        "id": "40d3d26c-bf99-40c8-938d-8189d6e0ad5d",
                        "level": 0,
                        "email": "a"
                    },
            {
                        "email": "b",
                        "id": "40d3d26c-bf99-40c8-938d-8189d6e0ad5e",
                        "level": 0
                    }                   
                ],
                "decryption": "none"
            },
            "streamSettings": {
                "network": "ws",
                "security": "none",
                "wsSettings": {
                    "acceptProxyProtocol": true,
                    "path": "/z000"
                }
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom"
        }
    ]
}

我是瞎搞的,不知道怎么弄才能成功,请大佬点拨,谢谢。

GeorgeRudd commented 3 years ago

第一种配置有个地方括号写多了,修改之后就能用了