v2fly / v2ray-core

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

V2Ray 5.12.1如何使用alterID #2855

Closed LM99v closed 4 weeks ago

LM99v commented 7 months ago

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

5.12.1

你的使用场景是什么?

VMESS+HttpUpgrade代理访问网站

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

windows版本的v2ray配置文件包含alterID设置会报错,服务端linux版本不会报错

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

请附上你的配置

服务端配置:

{ "log": { "loglevel": "warning" }, "outbounds": [ { "protocol": "freedom" } ], "inbounds": [ { "protocol": "vmess", "settings": {xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx "users": ["xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"], "alterId":0 }, "listen": "0.0.0.0", "port": 1111, "streamSettings": { "transport": "httpupgrade", "transportSettings": { "host": "xxxxxx.eu.org", "path": "/xxxxxx" } } } ] }


**客户端配置:**
{
  // List of inbound proxy configurations.
  "inbounds": [
    {
      "protocol": "socks",
      "settings": {
        "udpEnabled": true,
        "address": "127.0.0.1",
        "packetEncoding": "Packet"
      },
      "port": 1081
    }
  ],
  // List of outbound proxy configurations.
  "outbounds": [
    {
      "protocol": "vmess",
      "settings": {
      "address": "jimmy4phd.eu.org", // 服务器地址,请修改为你自己的服务器 ip 或域名
      "port": 443, // 服务器端口
      "uuid": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx", //你的UUID, 此ID需与服务端保持一致
      "alterId": 0
      },
      "streamSettings":{
      "transport": "httpupgrade",
      "transportSettings": {
          "host": "xxxxxx.eu.org",
          "path": "/xxxxxx"
        },
      "security": "tls",
      "securitySettings": {
      "serverName": "xxxxxx.eu.org", //此域名是你服务器的域名
      "allowInsecure": false,
      "nextProtocol": [
        "http/1.1"
      ],
      "certificate": [
        {
            "certificateFile": "ca.pem",
            "keyFile": "xxxx.key"
//         "disableSystemRoot": true
          }
        ]
}
      }
    }
  ]
}
```javascript
// 在这里附上客户端配置

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

服务器端错误日志:

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

客户端错误日志: ./v2ray run -c config.json -format jsonv5 V2Ray 5.12.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.21.4 windows/amd64) A unified platform for anti-censorship. Failed to start: main/commands: failed to load config: [config.json] > infra/conf/v5cfg: unable to build config > infra/conf/v5cfg: unable to load outbound protocol config > common/registry: unable to parse json content > unknown field "alterId" in v2ray.core.proxy.vmess.outbound.SimplifiedConfig

直接运行会报错 infra/conf/v4: 0 VMess receiver configured

// 在这里附上客户端日志

请附上访问日志

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

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

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

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

AkinoKaede commented 5 months ago

It's not supported in JsonV5 format, and the default value is 0. If you want to use VMess MD5, you can rewrite the configuration in JsonV4 and set the environment variable. V2RAY_VMESS_AEAD_FORCED=false

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days