Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么v2ray能正常工作的config.json拷贝到xray报错:Unable to Read Header Len #2633

Closed
sunday-will opened this issue Oct 12, 2023 · 4 comments

Comments

@sunday-will
Copy link

sunday-will commented Oct 12, 2023

测试方法:

  1. 在本地开启v2ray,浏览器通过11080能正常访问google.com
  2. 拷贝config.json到xray,不能访问
  3. alterId64改成0,还是不能访问

报错内容:

2023/10/12 14:13:35 [Info] [850403104] proxy/socks: TCP Connect request to tcp:www.google.com:443
2023/10/12 14:13:35 [Info] [850403104] app/dispatcher: sniffed domain: www.google.com
2023/10/12 14:13:35 [Info] [850403104] app/dispatcher: taking detour [outbound-1] for [tcp:www.google.com:443]
2023/10/12 14:13:35 [Info] [850403104] transport/internet/websocket: creating connection to tcp:156.225.67.104:30000
2023/10/12 14:13:35 [Debug] transport/internet: dialing to tcp:156.225.67.104:30000
2023/10/12 14:13:35 tcp:127.0.0.1:12889 accepted tcp:www.google.com:443 [inbound-1 -> outbound-1]
2023/10/12 14:13:35 [Info] [154713875] proxy/vmess/outbound: tunneling request to tcp:backup.bar-navig.com:443 via 156.225.67.104:30000
2023/10/12 14:13:35 [Info] [154713875] app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: connection ends > proxy/vmess/outbound: failed to read header > common/drain: common/drain: unable to drain connection > websocket: close 1000 (normal) > proxy/vmess/encoding: Unable to Read Header Len > websocket: close 1000 (normal)
2023/10/12 14:13:35 [Info] [154713875] app/proxyman/inbound: connection ends > proxy/socks: connection ends > proxy/socks: failed to transport all TCP response > io: read/write on closed pipe

config.json配置文件:

// Config file of V2Ray. This file follows standard JSON format, with comments support.
// Uncomment entries below to satisfy your needs. Also read our manual for more detail at
// https://www.v2fly.org/
{
  "log": {
    "loglevel": "debug"
  },
  
  "inbounds": [{
	"tag": "inbound-1",	// 声明入口
	  
    "port": 11080,

    "listen": "127.0.0.1",

    "protocol": "socks",

    "settings": {
      "auth": "noauth",
      "udp": false,
      "ip": "127.0.0.1"
    },

    "sniffing": {
      "enabled": true,
      // Target domain will be overriden to the one carried by the connection, if the connection is HTTP or HTTPS.
      "destOverride": ["http", "tls"]
    }
  }],
  
  "outbounds": [{
    "tag": "direct",
    "protocol": "freedom",
    "settings": {}
  },{
    "tag": "blocked",
    "protocol": "blackhole",
    "settings": {}
  },{
      "tag": "outbound-1",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "156.225.67.104",
            "port": 30000,
            "users": [
              {
                "id": "29a5d48e-24f1-48fd-a5e1-9a46cb31032f",
                "alterId": 64
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "tlsSettings": {
          "allowInsecure": true,
          "serverName": "www.41758112.xyz",
          "show": false
        },
        "wsSettings": {
          "path": "/path/1696944806961",
          "headers": {
            "Host": "www.41758112.xyz"
          }
        }
      },
      "mux": {
        "enabled": false,
        "concurrency": -1
      }
    }],

   "routing": {
    "domainStrategy": "IPOnDemand",
    "rules":[
	  {
		  "type": "field",
		  "inboundTag": ["inbound-1"],
		  "outboundTag": "outbound-1"
	  }
    ]
  },

  "other": {}
}
@zxbiao
Copy link

zxbiao commented Oct 12, 2023

#2620 (comment)

@sunday-will
Copy link
Author

sunday-will commented Oct 12, 2023

你好!非常感谢您的及时回复!

刚学习使用xray的使用。 官方文档说完全兼容v2ray-core配置,不清楚还有哪些不同点,而且看官方关于vmess的具体配置项,
v2ray和xray两个配置内容完全相同,所以有没有可能是个bug。

XTLS are brilliant ideas for TLS we study, while Xray is the best practice we maintain.

Xray-core 是 v2ray-core 的超集,含更好的整体性能和 XTLS 等一系列增强,且完全兼容 v2ray-core 的功能及配置。

@zxbiao
Copy link

zxbiao commented Oct 13, 2023

1.8.x已经移除了对部分旧有协议的支持

vmess+ws+tls并不能解决tls in tls特征,会被gfw关注的。过cdn虽然不会被封ip,但会被频繁地干扰。如果不过cdn,那看gfw的心情了。还有vmess的旧版本协议有漏洞,会被精确的识别。

net4people/bbs#129 (comment)

@yuhan6665
Copy link
Member

closing for now as issue with deprecated VMESS config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants