V2ray-core: 突然出现的 failed to read header 错误

Created on 12 Apr 2018  ·  14Comments  ·  Source: v2ray/v2ray-core

Please skip to the English section below if you don't write Chinese.

中文:
提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。
除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
Server 3.11
Client 3.16
2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
直接用 curl 带socks5 代理访问一个网址
curl --socks5 127.0.0.1:1789 ip.cn
3) 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
curl 出现 curl: (52) Empty reply from server
4) 你期待看到的正确表现是怎样的?
看到服务器IP
5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:
   {
  "inbound": {
    "port": 10000,
    "listen": "127.0.0.1",
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "email": "@v2ray.com",
          "id": "85ab0d08-49e0-443e-8da5-***",
          "alterId": 64,
          "security": "AES-128-GCM"
        },
        {
          "email": "@v2ray.com",
          "id": "6ba3b2da-25aa-46e9-871e-***",
          "alterId": 64,
          "security": "AES-128-GCM"
        },
        {
          "email": "@v2ray.com",
          "id": "242e37cc-d22f-4e52-ad85-***",
          "alterId": 64,
          "security": "AES-128-GCM"
        },
        {
          "email": "@v2ray.com",
          "id": "4c226527-6168-4466-be6c-***",
          "alterId": 64,
          "security": "AES-128-GCM"
        },
        {
          "email": "@v2ray.com",
          "id": "dda9d0ba-c3a1-455e-8f85-***",
          "alterId": 64,
          "security": "AES-128-GCM"
        }
      ]
    },
    "streamSettings": {
      "network": "ws",
      "wsSettings": {
        "path": "/"
      }
    },
    "mux": {
      "enabled": true
    }
  },
  "inboundDetour": [
    {
      "port": ***,
      "listen": "***",
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "email": "@v2ray.com",
            "id": "4c226527-6168-4466-be6c-***",
            "alterId": 64,
            "security": "AES-128-GCM"
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "tcpSetting": {}
      },
      "mux": {
        "enabled": true
      }
    }
  ],
  "outbound": {
    "protocol": "freedom",
    "settings": {}
  },
  "outboundDetour": [
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "strategy": "rules",
    "settings": {
      "rules": [
        {
          "type": "field",
          "ip": [
            "0.0.0.0/8",
            "10.0.0.0/8",
            "100.64.0.0/10",
            "127.0.0.0/8",
            "169.254.0.0/16",
            "172.16.0.0/12",
            "192.0.0.0/24",
            "192.0.2.0/24",
            "192.168.0.0/16",
            "198.18.0.0/15",
            "198.51.100.0/24",
            "203.0.113.0/24",
            "::1/128",
            "fc00::/7",
            "fe80::/10"
          ],
          "outboundTag": "blocked"
        }
      ]
    }
  }
}

客户端配置:
    {
  "log": {
    "loglevel": "Debug"
  },
  "inbound": {
    "port": 54321,
    "listen": "0.0.0.0",
    "protocol": "dokodemo-door",
    "settings": {
      "network": "tcp,udp",
      "followRedirect": true
    },
    "tag": "default_iptables_in",
    "domainOverride": [
      "tls",
      "http"
    ]
  },
  "inboundDetour": [
    {
      "port": 3128,
      "listen": "0.0.0.0",
      "protocol": "http",
      "settings": {},
      "tag": "p3128"
    },
    {
      "port": 1789,
      "listen": "0.0.0.0",
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true
      },
      "tag": "p1789"
    },
    {
      "port": 1081,
      "listen": "0.0.0.0",
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true
      },
      "tag": "p1081"
    },
    {
      "port": 1082,
      "listen": "0.0.0.0",
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true
      },
      "tag": "p1082"
    }
  ],
  "outbound": {
    "protocol": "freedom",
    "settings": {},
    "tag": "default_direct_out"
  },
  "outboundDetour": [
    {
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "***",
            "port": ***,
            "users": [
              {
        "email": "***@v2ray.com",
                "id": "4c226527-6168-4466-be6c-***",
                "alterId": 64,
                "security": "AES-128-GCM"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "tlsSettings": {
          "serverName": "***.com"
        },
        "wsSettings": {
          "path": "/",
          "headers": {
            "Host": "***.com"
          }
        },
        "mux": {
          "enabled": true,
          "concurrency": 32
        }
      },
      "tag": "cloudflare_ws_out"
    },
    {
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "***",
            "port": ***,
            "users": [
              {
        "email": "***@v2ray.com",
                "id": "4c226527-6168-4466-be6c-***",
                "alterId": 64,
                "security": "AES-128-GCM"
              }
            ]
          }
        ],
        "streamSettings": {
          "network": "tcp"
        }
      },
      "tag": "us_out"
    },
    {
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "***",
            "port": ***,
            "users": [
              {
                "id": "4c226527-6168-4466-be6c-***",
                "alterId": 64,
                "security": "AES-128-GCM"
              }
            ]
          }
        ],
        "streamSettings": {
          "network": "tcp"
        }
      },
      "tag": "us2_out"
    }
  ],
  "routing": {
    "strategy": "rules",
    "settings": {
      "domainStrategy": "IPIfNonMatch",
      "rules": [
        {
          "type": "field",
          "inboundTag": [
            "default_iptables_in",
            "p3128",
            "p1789"
          ],
          "outboundTag": "cloudflare_ws_out"
        },
        {
          "type": "field",
          "inboundTag": [
            "p1081"
          ],
          "outboundTag": "us_out"
        },
        {
          "type": "field",
          "inboundTag": [
            "p1082"
          ],
          "outboundTag": "us2_out"
        },
        {
          "type": "chinasites",
          "outboundTag": "default_direct_out"
        },
        {
          "type": "chinaip",
          "outboundTag": "default_direct_out"
        },
        {
          "type": "field",
          "ip": [
            "geoip:private"
          ],
          "outboundTag": "default_direct_out"
        }
      ]
    }
  }
}

6) 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:

客户端错误日志:
    2018/04/12 16:19:15 [Debug] App|Log: Logger started
2018/04/12 16:19:15 [Warning] Core: V2Ray v3.16 started
2018/04/12 16:19:17 [Info] [3507273553] Proxy|Socks: TCP Connect request to tcp:167.88.158.176:80
2018/04/12 16:19:17 tcp:192.168.11.10:35676 accepted tcp:167.88.158.176:80
2018/04/12 16:19:17 [Info] [3507273553] App|Dispatcher: taking detour [us_out] for [tcp:167.88.158.176:80]
2018/04/12 16:19:17 [Info] [3507273553] Transport|Internet|TCP: dialing TCP to tcp:***:****
2018/04/12 16:19:17 [Info] [3507273553] Proxy|VMess|Outbound: tunneling request to tcp:167.88.158.176:80 via tcp:***:****
2018/04/12 16:19:17 [Info] [3507273553] App|Proxyman|Outbound: failed to process outbound traffic > Proxy|VMess|Outbound: connection ends > Proxy|VMess|Outbound: failed to read header > Proxy|VMess|Encoding: failed to read response
header > EOF
2018/04/12 16:19:17 [Info] [3507273553] App|Proxyman|Inbound: connection ends > Proxy|Socks: connection ends > Proxy|Socks: failed to transport all TCP response > io: read/write on closed pipe

7) 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。

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

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

如上环境 我在 国外VPS上跑 客户端程序后 是可以用过 curl 获取到 运行客户端的国外VPS的ip的
比较神奇
最近2天突然出现的
运营商是 电信

Most helpful comment

最后原因是我客户端linux和树莓派时间都不准时造成的…我也很无奈…

All 14 comments

目测把 server 升到 3.16 可解,或者关掉客户端的 mux。

把服务器端 和 客户端版本一致后 也去掉了客户端的mux 配置节点。错误依旧。 同一套配置 我客户端运行在国外vps上 是没有问题的。。。。

于是这个问题有原因么,想了解一下

最后原因是我客户端linux和树莓派时间都不准时造成的…我也很无奈…

@kuyagic 不知道为何我的 MacBookPro 的时间早了大概 5 分钟,手动设置回来就 OK 了,谢谢你的 comment,很有用。

遇到了一样的问题,时间不对

windows下遇到相同问题,时间差了几分钟

相同问题。同样配置一台机器可以一台不可以,莫名奇妙了半天,看了评论一看时间,恍然大悟。

windows下也遇到了同样的问题,看了一下发现是linux双系统导致windows系统时间不对,同步之后就可以了

mac 与 Windows 双系统时间不同步,同步时间后问题解决。

最后原因是我客户端linux和树莓派时间都不准时造成的…我也很无奈…

我是小白,window时间知道,另一个时间指什么时间,我用的v2rayN

最后原因是我客户端linux和树莓派时间都不准时造成的…我也很无奈…

我是小白,window时间知道,另一个时间指什么时间,我用的v2rayN

v2ray服务端所在时间

最后原因是我客户端linux和树莓派时间都不准时造成的…我也很无奈…

我是小白,window时间知道,另一个时间指什么时间,我用的v2rayN

v2ray服务端所在时间
我的服务端时间格式如下,和我设备是一致的!是时间格式影响了吗
Thu Feb 27 17:36:12 CST 2020

Same:系统时钟问题。ntp同步之后就OK了。

Was this page helpful?
0 / 5 - 0 ratings