crossfw / Air-Universe

开源多功能机场后端, 协议支持 V2Ray(VMess), Trojan, Shadowsocks(单端口多用户);面板支持 SSPanel, v2board, django-sspanel.
GNU General Public License v3.0
674 stars 223 forks source link

请问如何为 inbound 启用 TCP 快速打开? #16

Open tearfulDalvik opened 2 years ago

tearfulDalvik commented 2 years ago

根据 v2ray 文档(https://www.v2ray.com/chapter_02/05_transport.html#streamsettingsobject),强制打开 TFO 的选项在 StreamSettingsObject 中,但StreamSettingsObject包含在inbound中,而这是由 Airu 控制的部分。

请问如何手动强制打开 tfo 呢?

crossfw commented 2 years ago

手动配置Xray入站

tearfulDalvik commented 2 years ago

手动配置Xray入站

请问如何配置呢?这个部分不是由 airu 从 API 自动添加的吗?

zhyonc commented 2 years ago

手动配置Xray入站

请问如何配置呢?这个部分不是由 airu 从 API 自动添加的吗?

  • Route:client->xray:443[tfo-in]->xray[direct-out]->au10084->xray10085[api]->xray[raw-in]->xray[direct-out]
//Xray server config.json
{
    "inbouds": [
    {
        "listen": "127.0.0.1",
        "port": 443,
        "protocol": "dokodemo-door",
        "settings":
        {
            "address": "127.0.0.1",
            "port": 10084 //v2board node server port is equivalent to air-universe listening port
        },
        "streamSettings":
        {
            "network": "tcp",
            "security": "tls",
            "tlsSettings":
            {
                "certificates": [
                {
                    "certificateFile": "/path/to/fullchain.crt",
                    "keyFile": "/path/to/private.key"
                }]
            },
            "sockopt":
            {
                "tcpFastOpen": true
            }
        },
        "tag": "tfo-in"
    },
    {
        "listen": "127.0.0.1",
        "port": 10085, //This port use for air-universe callback api to create user info
        "protocol": "dokodemo-door",
        "settings":
        {
            "address": "127.0.0.1"
        },
        "tag": "api"
    }],
    "outbounds": [
    {
        "protocol": "freedom",
        "settings": {},
        "tag": "direct-out"
    }],
    "api":
    {
        "services": [
            "HandlerService",
            "StatsService"
        ],
        "tag": "api"
    },
    "stats":{},
    "policy":
    {
        "levels":
        {
            "0":
            {
                "statsUserDownlink": true,
                "statsUserUplink": true
            }
        }
    },
    "routing":
    {
        "rules": [
        {
            "type": "field",
            "domainStrategy": "AsIs",
            "inboundTag": ["tfo-in","raw-in"],
            "outboundTag": "direct-out"
        },
        {
            "type": "field",
            "domainStrategy": "AsIs",
            "inboundTag": ["api"],
            "outboundTag": "api"
        }]
    }
}
//Air-Universe au.json
"proxy":
{
    "type": "xray",
    "alter_id": 0,
    "auto_generate": true,
    "in_tags": ["raw-in"],
    "api_address": "127.0.0.1",
    "api_port": 10085,
    "force_close_tls": true,
    "log_path": "/var/log/au.log",
    "cert":
    {
        "cert_path": "/path/to/certificate.crt",
        "key_path": "/path/to/key.key"
    },
    "speed_limit_level": [0]
}