dyhkwong / Exclave

A fork of SagerNet powered by V2Ray and its derivatives
https://t.me/exclavian
Other
603 stars 37 forks source link

无法启动导入的自定义V2Ray或V2Ray Outbound配置 #65

Closed wongwengtim closed 3 months ago

wongwengtim commented 3 months ago

提交问题之前,请确保您使用的是最新版本。


描述问题

无法启动导入的自定义V2Ray或V2Ray Outbound配置。

如何复现

复现步骤:

  1. 在Exclave新建一个VMess,保持所有配置为默认。
  2. 导出完整配置到剪切板。
  3. 将完整配置填入自定义配置,或将Outbound部分单独填入V2Ray Outbound。
  4. 启动该自定义配置。

调试信息

完整配置

{
  "dns": {
    "fallbackStrategy": "disabledIfAnyMatch",
    "hosts": {},
    "servers": [
      {
        "address": "tcp://1.1.1.1",
        "fakedns": [
          {
            "ipPool": "198.18.0.0/15",
            "poolSize": 65535
          }
        ],
        "queryStrategy": "UseIPv4"
      }
    ]
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 2080,
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true
      },
      "sniffing": {
        "destOverride": [
          "fakedns",
          "http",
          "tls",
          "quic"
        ],
        "enabled": true,
        "metadataOnly": false,
        "routeOnly": true
      },
      "tag": "socks"
    },
    {
      "listen": "127.0.0.1",
      "port": 9080,
      "protocol": "http",
      "settings": {
        "allowTransparent": true
      },
      "sniffing": {
        "destOverride": [
          "fakedns",
          "http",
          "tls",
          "quic"
        ],
        "enabled": true,
        "metadataOnly": false,
        "routeOnly": true
      },
      "tag": "http"
    },
    {
      "listen": "127.0.0.1",
      "port": 6450,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "1.0.0.1",
        "network": "tcp,udp",
        "port": 53
      },
      "tag": "dns-in"
    }
  ],
  "log": {
    "loglevel": "error"
  },
  "outbounds": [
    {
      "domainStrategy": "AsIs",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "127.0.0.1",
            "port": 1080,
            "users": [
              {
                "id": "e129f27c-5103-5c5c-844b-cdf0a15e160d",
                "security": "auto"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "none",
        "tcpSettings": {}
      },
      "tag": "proxy-global-7"
    },
    {
      "protocol": "freedom",
      "tag": "direct"
    },
    {
      "protocol": "freedom",
      "tag": "bypass"
    },
    {
      "protocol": "blackhole",
      "tag": "block"
    },
    {
      "protocol": "dns",
      "proxySettings": {
        "tag": "proxy-global-7",
        "transportLayer": true
      },
      "settings": {
        "address": "1.1.1.1",
        "network": "tcp",
        "port": 53,
        "userLevel": 1
      },
      "tag": "dns-out"
    }
  ],
  "policy": {
    "levels": {
      "1": {
        "connIdle": 30
      }
    },
    "system": {
      "statsOutboundDownlink": true,
      "statsOutboundUplink": true
    }
  },
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "inboundTag": [
          "dns-in"
        ],
        "outboundTag": "dns-out",
        "type": "field"
      }
    ]
  },
  "stats": {}
}

预期行为

正常启动连接

屏幕截图

IMG_20240812_084618

设备信息

附加上下文

在此处添加有关该问题的任何其他上下文。

dyhkwong commented 3 months ago

其实 V2Ray Outbound 配置的“服务器”一般是要填的(如果服务器地址是域名的话),用于在 DNS 解析中避免解析回环。

由于 v2ray json 的服务器地址在不同 outbound 中的配置方式并不统一,所以我当时并没有写自动获取服务器地址。

wongwengtim commented 3 months ago

上述的配置中服务器地址是IP,但同样报错。 测试了选择V2Ray Outbound类型再填写该IP地址可以正常连接。 而完整V2Ray配置因无法填写服务器地址而无法连接。