v2ray / v2ray-core

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

v2ray升级到3.1后,mkcp工作不正常 #773

Closed hkfires closed 6 years ago

hkfires commented 6 years ago

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明) 客户端和服务端均为3.1 2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。 使用Chrome通过VMess代理浏览网页。 3) 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等) 使用mKCP传输,服务端和客户端都升级到3.1版本后出错,无法正常使用,并且v2ray服务运行一段时间后会down掉。如果将服务端降级到2.50,客户端保持3.1,则工作正常。 4) 你期待看到的正确表现是怎样的? 3.1的mKCP正常工作。 5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:
{
        "log": {
                "access": "/var/log/v2ray/access.log",
                "error": "/var/log/v2ray/error.log",
                "loglevel": "warning"
        },
        "inbound": {
                "protocol": "vmess",
                "port": 28763,
                "settings": {
                        "clients": [{
                                "id": "myid",
                                "alterId": 64
                        }],
                        "detour": {
                                "to": "dynamic_port"
                        }
                },
                "streamSettings": {
                        "network": "kcp",
                        "kcpSettings": {
                                "mtu": 1350,
                                "tti": 20,
                                "uplinkCapacity": 6,
                                "downlinkCapacity": 100,
                                "congestion": true,
                                "readBufferSize": 2,
                                "writeBufferSize": 2,
                                "header": {
                                        "type": "srtp"
                                }
                        }
                }
        },
        "inboundDetour": [{
                "protocol": "vmess",
                "port": "40000-50000",
                "tag": "dynamic_port",
                "settings": {

                },
                "allocate": {
                        "strategy": "random",
                        "concurrency": 10,
                        "refresh": 10
                },
                "streamSettings": {
                        "network": "kcp",
                        "kcpSettings": {
                                "mtu": 1350,
                                "tti": 20,
                                "uplinkCapacity": 6,
                                "downlinkCapacity": 100,
                                "congestion": true,
                                "readBufferSize": 2,
                                "writeBufferSize": 2,
                                "header": {
                                        "type": "srtp"
                                }
                        }
                }
        },
        {
                "protocol": "shadowsocks",
                "port": "29999",
                "settings": {
                        "method": "aes-256-cfb",
                        "password": "mypassword",
                        "udp": true
                }
        }],
        "outbound": {
                "protocol": "freedom",
                "settings": {

                }
        }
}
客户端配置:
{
        "inbound": {
                "port": 1080,
                "protocol": "http",
                "settings": {
                        "auth": "noauth"
                }
        },
        "inboundDetour": [{
                "port": 1081,
                "protocol": "socks",
                "settings": {
                        "udp": true,
                        "ip": "127.0.0.1",
                        "auth": "noauth"
                }
        }],
        "outbound": {
                "protocol": "vmess",
                "settings": {
                        "vnext": [{
                                "address": "ip_address",
                                "port": 28763,
                                "users": [{
                                        "id": "myid",
                                        "alterId": 64,
                                        "security": "aes-128-gcm"
                                }]
                        }]
                },
                "streamSettings": {
                        "network": "kcp",
                        "kcpSettings": {
                                "mtu": 1350,
                                "tti": 20,
                                "uplinkCapacity": 6,
                                "downlinkCapacity": 100,
                                "congestion": true,
                                "readBufferSize": 2,
                                "writeBufferSize": 2,
                                "header": {
                                        "type": "srtp"
                                }
                        }
                }
        }
}

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

服务器端错误日志:
2017/12/08 22:40:40 [Warning]Core: V2Ray started
客户端错误日志:
12月 09 09:51:00 raspberrypi3 systemd[1]: Started V2Ray Service.
12月 09 09:51:01 raspberrypi3 v2ray[565]: V2Ray v3.1 (die Commanderin) 20171207
12月 09 09:51:01 raspberrypi3 v2ray[565]: An unified platform for anti-censorship.
12月 09 09:51:01 raspberrypi3 v2ray[565]: 2017/12/09 09:51:01 [Debug]App|Proxyman|Inbound: creating tcp worker on 0.0.0.0:1080
12月 09 09:51:01 raspberrypi3 v2ray[565]: 2017/12/09 09:51:01 [Debug]App|Proxyman|Inbound: creating tcp worker on 0.0.0.0:1081
12月 09 09:51:01 raspberrypi3 v2ray[565]: 2017/12/09 09:51:01 [Warning]Core: V2Ray started

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

2017/12/08 22:40:42 ip1:51235 rejected  Proxy|VMess|Encoding: failed to read request header > Transport|Internet|mKCP: Read/Write timeout
2017/12/08 22:40:43 ip2:58336 rejected  Proxy|VMess|Encoding: failed to read request header > Transport|Internet|mKCP: Read/Write timeout
hkfires commented 6 years ago

今天升级到3.2版本,问题依旧,服务启动时依旧有连接错误的报告,运行一段时间还是会Down掉

DarienRaymond commented 6 years ago

3.3 应该修复了这个问题。

richardyrh commented 6 years ago

3.4 似乎问题还存在(可能是这个问题,报错一样),表现情况为使用一段时间后上行带宽飙升至路由器极限,之后卡慢并影响局域网其他设备

hkfires commented 6 years ago

升级到3.4目前mkcp工作正常,但是v2ray服务还是会一段时间就会退出,环境是openvz的centos6 access日志里正常,只有访问日志,这里就不贴了,error日志里升级到3.4之后的日志如下: 2017/12/20 09:39:28 [Warning]App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: unable to set read deadline > Transport|Internet|mKCP: Connection closed. 2017/12/22 22:10:42 [Warning]Core: V2Ray started 2017/12/24 10:57:08 [Warning]Core: V2Ray started 2017/12/24 10:57:08 [Warning]App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: unable to set read deadline > Transport|Internet|mKCP: Connection closed. 2017/12/24 10:57:08 [Warning]App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: unable to set read deadline > Transport|Internet|mKCP: Connection closed. 2017/12/24 10:57:08 [Warning]App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: unable to set read deadline > Transport|Internet|mKCP: Connection closed. 2017/12/24 10:57:08 [Warning]App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: unable to set read deadline > Transport|Internet|mKCP: Connection closed. 2017/12/24 10:57:08 [Warning]App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: unable to set read deadline > Transport|Internet|mKCP: Connection closed. 2017/12/24 10:57:08 [Warning]App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: unable to set read deadline > Transport|Internet|mKCP: Connection closed. 2017/12/24 11:40:44 [Warning]: Core: V2Ray started 2017/12/28 18:59:34 [Warning]: Core: V2Ray started

strahe commented 6 years ago

目前已经3.25了, 还是遇到跟你一样的情况, 时不时中断.

qingfengshi commented 6 years ago

如果服务器配置过低就会出现这样的情况,特别是流量大的时候

On Wed, Jun 6, 2018 at 10:36 PM, strahe notifications@github.com wrote:

目前已经3.25了, 还是遇到跟你一样的情况, 时不时中断.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/v2ray/v2ray-core/issues/773#issuecomment-395091201, or mute the thread https://github.com/notifications/unsubscribe-auth/ATfMTD22aZ-WDzn5BINRDPJwXHfQEORSks5t5-jtgaJpZM4Q75Gw .

chalau commented 5 years ago

但相同配置方法,反而是配置低的连得上、配置高的立即断开,请指点迷津,谢谢