v2fly / v2ray-core

A platform for building proxies to bypass network restrictions.
https://v2fly.org
MIT License
29.18k stars 4.61k forks source link

v2ray 无法加载 jsonv5 的 transportSettings #2846

Closed Yhaiyang closed 9 months ago

Yhaiyang commented 9 months ago

你正在使用哪个版本的 V2Ray?

V2Ray 5.13.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.21.4 linux/amd64) A unified platform for anti-censorship.

你的使用场景是什么?

下载海外资源

你看到的异常现象是什么?

v2ray 无法启动

你期待看到的正常表现是怎样的?

v2ray 正常启动

请附上你的配置

服务端配置:

"inbounds": [{
        "port":"8088",
        "listen":"0.0.0.0",
        "protocol":"vmess",
        "tag":"vmess_in",
        "settings":{
          "users":["8031933c-ea45-4ed3-88bf-43c2f66298d0"]
        },
        "sniffing":{
          "enabled":false
        },
        "streamSettings": {
            "transport":"kcp",
            "transportSettings":{
                "congestion": true
            },
            "security":"none",
            "securitySettings":{}
        }
      }
    ]

客户端配置:

"outbounds": [{
        "protocol": "vmess",
        "settings": {
          "address": "jjs-pcg-ai.pai-net.work",
          "port": "8088",
          "uuid": "8031933c-ea45-4ed3-88bf-43c2f66298d0"
        },
        "sendThrough": "0.0.0.0",
        "tag": "vmess_out_1",
        "mux": {
          "enabled": false,
          "concurrency": 8
        },
        "streamSettings": {
            "transport":"kcp",
            "transportSettings":{
                "uplinkCapacity": 12,
                "downlinkCapacity": 100,
                "congestion": true
            },
            "security":"none",
            "securitySettings":{}
        }
      }
    ],

请附上出错时软件输出的错误日志

服务器端错误日志:

// 在这里附上服务器端日志

客户端错误日志:

Failed to start: main/commands: failed to load config: [aidn_kcp1_in.json] > infra/conf/v5cfg: unable to build config > infra/conf/v5cfg: unable to load transport config > common/registry: unable to parse json content > json: cannot unmarshal number into Go value of type map[string]json.RawMessage

请附上访问日志

// 在这里附上服务器端日志

其它相关的配置文件(如 Nginx)和相关日志

如果 V2Ray 无法启动,请附上 --test 命令的输出

Test failed: main/commands: failed to load config: [aidn_kcp1_in.json] > infra/conf/v5cfg: unable to build config > infra/conf/v5cfg: unable to load transport config > common/registry: unable to parse json content > json: cannot unmarshal number into Go value of type map[string]json.RawMessage

如果 V2Ray 服务运行异常,请附上 journal 日志

dyhkwong commented 9 months ago

这是文档错误。关于 KCP 的实际配置格式可以参考 transport/internet/kcp/config.proto。不知道作者当年为什么要这样设计配置字段。

{
    "mtu": {
        "value": 0
    },
    "tti": {
        "value": 0
    },
    "uplinkCapacity": {
        "value": 0
    },
    "downlinkCapacity": {
        "value": 0
    },
    "congestion": false,
    "writeBuffer": {
        "size": 0
    },
    "readBuffer": {
        "size": 0
    },
    "seed": {
        "seed": ""
    }
}