v2ray / v2ray-core

A platform for building proxies to bypass network restrictions.
https://www.v2ray.com/
MIT License
45.29k stars 8.94k forks source link

kcp模式下,Github上传图片失败 #1347

Closed comwrg closed 5 years ago

comwrg commented 5 years ago

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。 除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。 如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明) 服务器: 3.50 客户端:3.47 2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。 KCP模式下,使用Chrome将图片拉进Issue内容框上传图片 3) 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等) image image

上传速度会直接到满速几秒钟(大概2M/s,图片大概2M) 之后就无法通过代理上网(但是ssh可以连接),过几分钟后自动恢复

4) 你期待看到的正确表现是怎样的? 上传成功 5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:

    // 在这里附上服务器端配置文件
{
  "log": {
    "loglevel": "warning",
    "access": "/var/log/v2ray/access.log", 
    "error": "/var/log/v2ray/error.log"
  },
  "inbound": {
    "port": 444,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "cdcb56f6-824e-47fc-a3b0-0641213814ce",
          "level": 1,
          "alterId": 64
        }
      ]
    },
    "streamSettings": {
      "network": "kcp",
      "kcpSettings": {
        "mtu": 1350,
        "tti": 20,
        "uplinkCapacity": 5,
        "downlinkCapacity": 100,
        "congestion": true,
        "readBufferSize": 2,
        "writeBufferSize": 2,
        "header": {
          "type": "none"
        }
      }
    }
  },
  "inboundDetour":[{
      "protocol": "shadowsocks",
      "port": 443,
      "tag": "ss",
      "settings": {
        "email":"love@v2ray.com",
        "method": "aes-128-cfb",
        "password": "passssssword",
        "level": 1,
        "ota": false,
        "network": "tcp,udp"
      }
    }
  ],
  "outbound": {
    "protocol": "freedom",
    "settings": {}
  },
  "outboundDetour": [
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "strategy": "rules",
    "settings": {
      "rules": [
        {
          "type": "field",
          "ip": ["geoip:private"],
          "outboundTag": "blocked"
        }
      ]
    }
  }
}

客户端配置:

    // 在这里附上客户端配置
{
  "policy" : {
    "levels" : {
      "0" : {
        "uplinkOnly" : 0
      }
    }
  },
  "dns" : {
    "servers" : [
      "localhost"
    ]
  },
  "outboundDetour" : [
    {
      "protocol" : "freedom",
      "tag" : "direct",
      "settings" : {

      }
    }
  ],
  "inbound" : {
    "listen" : "127.0.0.1",
    "port" : 1080,
    "protocol" : "socks",
    "settings" : {
      "auth" : "noauth",
      "udp" : false,
      "ip" : "127.0.0.1"
    }
  },
  "inboundDetour" : [
    {
      "listen" : "127.0.0.1",
      "allocate" : {
        "strategy" : "always",
        "refresh" : 5,
        "concurrency" : 3
      },
      "port" : 1087,
      "protocol" : "http",
      "tag" : "httpDetour",
      "domainOverride" : [
        "http",
        "tls"
      ],
      "streamSettings" : {

      },
      "settings" : {
        "timeout" : 0
      }
    }
  ],
  "log" : {
    "error" : "\/var\/folders\/x_\/vxyds7mx7cs8pq94w_y71cxc0000gn\/T\/cenmrev.v2rayx.log.DEC20132-84F1-4E22-9F3B-A367E054201A\/error.log",
    "loglevel" : "warning",
    "access" : "\/var\/folders\/x_\/vxyds7mx7cs8pq94w_y71cxc0000gn\/T\/cenmrev.v2rayx.log.DEC20132-84F1-4E22-9F3B-A367E054201A\/access.log"
  },
  "routing" : {
    "strategy" : "rules",
    "settings" : {
      "domainStrategy" : "IPIfNonMatch",
      "rules" : [

      ]
    }
  },
  "outbound" : {
    "sendThrough" : "0.0.0.0",
    "mux" : {
      "enabled" : false,
      "concurrency" : 8
    },
    "protocol" : "vmess",
    "settings" : {
      "vnext" : [
        {
          "address" : "(略去)",
          "port" : 444,
          "users" : [
            {
              "id" : "cdcb56f6-824e-47fc-a3b0-0641213814ce",
              "alterId" : 64,
              "security" : "auto",
              "level" : 1
            }
          ],
          "remark" : "server"
        }
      ]
    },
    "streamSettings" : {
      "sockopt" : {

      },
      "wsSettings" : {
        "path" : "",
        "headers" : {
          "Host" : "server.cc"
        }
      },
      "tlsSettings" : {
        "serverName" : "server.cc",
        "allowInsecure" : false
      },
      "httpSettings" : {
        "path" : "",
        "host" : [
          "server.cc"
        ]
      },
      "tcpSettings" : {
        "header" : {
          "type" : "none"
        }
      },
      "kcpSettings" : {
        "header" : {
          "type" : "none"
        },
        "mtu" : 1350,
        "congestion" : true,
        "tti" : 20,
        "uplinkCapacity" : 100,
        "writeBufferSize" : 2,
        "readBufferSize" : 2,
        "downlinkCapacity" : 100
      },
      "security" : "none",
      "network" : "kcp"
    }
  }
}

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

服务器端错误日志:

    // 在这里附上服务器端日志
2018/10/31 11:52:42 [Warning] v2ray.com/core: V2Ray 3.50 started
2018/10/31 11:52:58 [Warning] [2109496096] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/vmess/inbound: unable to set read deadline > v2ray.com/core/transport/internet/kcp: Connection closed.
2018/10/31 11:53:13 [Warning] [4220539520] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/vmess/inbound: unable to set read deadline > v2ray.com/core/transport/internet/kcp: Connection closed.

客户端错误日志:

    // 在这里附上客户端日志
2018/10/31 19:49:02 [Warning] v2ray.com/core: V2Ray 3.47 started

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

    // 在这里附上服务器端日志
2018/10/31 11:52:43 (略去IP):8833 accepted tcp:assets-cdn.github.com:443 
2018/10/31 11:52:46 (略去IP):3156 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:52:47 (略去IP):19254 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:52:48 (略去IP):54188 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:52:48 (略去IP):54042 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:52:48 (略去IP):36086 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:52:48 (略去IP):48154 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:52:49 (略去IP):48599 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:52:55 (略去IP):59256 accepted tcp:github.com:443 
2018/10/31 11:52:55 (略去IP):5654 accepted tcp:assets-cdn.github.com:443 
2018/10/31 11:52:57 (略去IP):4460 accepted tcp:avatars3.githubusercontent.com:443 
2018/10/31 11:52:58 (略去IP):50380 accepted tcp:live.github.com:443 
2018/10/31 11:52:58 (略去IP):23990 accepted tcp:f-log-extension.grammarly.io:443 
2018/10/31 11:53:02 (略去IP):3156 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:53:08 (略去IP):54188 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:53:08 (略去IP):36086 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:53:08 (略去IP):54042 rejected  v2ray.com/core/proxy/vmess/encoding: failed to read request header > v2ray.com/core/transport/internet/kcp: Read/Write timeout
2018/10/31 11:53:13 (略去IP):29710 accepted tcp:capi.grammarly.com:443 
2018/10/31 11:53:16 (略去IP):24962 accepted tcp:github.com:443 
2018/10/31 11:53:18 (略去IP):49619 accepted tcp:collector.githubapp.com:443 
2018/10/31 11:53:23 (略去IP):4600 accepted tcp:auth.grammarly.com:443 
2018/10/31 11:53:26 (略去IP):33733 accepted tcp:sourcegraph.com:443 
2018/10/31 11:53:26 (略去IP):3379 accepted tcp:live.github.com:443 
2018/10/31 11:53:26 (略去IP):34458 accepted tcp:data.grammarly.com:443 
2018/10/31 11:53:26 (略去IP):21998 accepted tcp:64.233.189.188:443 
2018/10/31 11:53:26 (略去IP):10349 accepted tcp:capi.grammarly.com:443 
2018/10/31 11:53:26 (略去IP):28119 accepted tcp:assets-cdn.github.com:443 
2018/10/31 11:53:26 (略去IP):64345 accepted tcp:avatars2.githubusercontent.com:443 
2018/10/31 11:53:27 (略去IP):36216 accepted tcp:sourcegraph.com:443 
2018/10/31 11:53:27 (略去IP):56656 accepted tcp:auth.grammarly.com:443 
2018/10/31 11:53:27 (略去IP):61987 accepted tcp:collector.githubapp.com:443 
2018/10/31 11:53:27 (略去IP):64449 accepted tcp:avatars2.githubusercontent.com:443 
2018/10/31 11:53:27 (略去IP):46097 accepted tcp:192.30.253.112:443 
2018/10/31 11:53:27 (略去IP):61690 accepted tcp:54.83.240.247:443 
2018/10/31 11:53:27 (略去IP):22719 accepted tcp:54.82.135.50:443 
2018/10/31 11:53:27 (略去IP):29889 accepted tcp:151.101.228.133:443 
2018/10/31 11:53:27 (略去IP):6773 accepted tcp:192.30.253.116:443 
2018/10/31 11:53:27 (略去IP):39859 accepted tcp:18.232.196.220:443 
2018/10/31 11:53:27 (略去IP):48590 accepted tcp:52.216.160.219:443 
2018/10/31 11:53:59 (略去IP):18091 accepted tcp:52.216.160.219:443 

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

9) 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

10) 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

请预览一下你填的内容再提交。

comwrg commented 5 years ago

尝试将搭建服务器在本地连接上传,结果是可以上传

猜测是GFW检测到某些异常后将包直接丢弃(理由:查看服务器的下载流量并为大幅度增长)(异常似乎跟图片大小有关系,几百KB的可以上传成功,但是几MB的上传异常,不过kcp是基于udp分片传输的,按道理应该没啥关系。。)

并封禁该端口几分钟( 理由:尝试代理无响应状态下使用不同IP连接,并未响应(几分钟后恢复),但ssh仍可以连接)

judgeou commented 5 years ago

你这种情况,我经历过,原因就是运营商对UDP的QOS,当UDP流量过大,会封锁该远程IP的UDP连接,但TCP不受影响。

comwrg commented 5 years ago

你这种情况,我经历过,原因就是运营商对UDP的QOS,当UDP流量过大,会封锁该远程IP的UDP连接,但TCP不受影响。

了解了,谢谢~