v2ray / v2ray-core

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

socks5连接复用 #742

Closed SacredOath closed 6 years ago

SacredOath commented 6 years ago

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明) 服务端v2.50,客户端从v2.47到v2.51.2都出现问题 2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。 ws+tls+nginx chrome+SwitchyOmega,Dropbox,Telegram,全部通过socks5连接 3) 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等) 开启Dropbox并上传文件时,别的通过socks5连接的程序会中断,,比如打不开google,Telegram连接失败,并在v2ray软件出现错误日志.通过字面意思应该是不能复用服务器连接. 4) 你期待看到的正确表现是怎样的? 多程序同时连接v2ray的socks5代理并正常工作 5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:
    {
  "log" : {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbound": {
    "port": 10000,
    "listen":"127.0.0.1",
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "XXX",
          "level": 1,
          "alterId": 64
        },
        {
          "id": "XXX",
          "level": 1,
          "alterId": 64
        },
        {
          "id": "XXX",
          "level": 1,
          "alterId": 64
        }
      ]
    },
    "streamSettings": {
      "network": "ws",
      "wsSettings": {
        "path": "/",
    "headers": {
      "Host": "www.ray.com"
    }
      }
    }
  },

  "inboundDetour": [

    {
      "protocol": "shadowsocks",
      "port": 16099,
      "settings": {
        "method": "chacha20",
        "password": "Abqwe123",
        "udp": 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": "warning"
  },
  "inbound": {
    "port": 1081,
    "listen": "127.0.0.1",
    "protocol": "socks",
    "settings": {
      "auth": "noauth",
      "udp": true,
      "ip": "127.0.0.1"
    }
  },
  "outbound": {
    "protocol": "vmess",
    "settings": {
      "vnext": [
        {
          "address": "我的域名",
          "port": 443,
          "users": [
            {
              "id": "XXX",
              "alterId": 64,
              "security": "auto"
            }
          ]
        }
      ]
    },
    "mux": {
      "enabled": true
    },
    "streamSettings": {
      "network": "ws",
      "security": "tls",
      "wsSettings": {
        "path": "/",
        "headers": {
          "Host": "www.ray.com"
        }
      }
    }
  },
  "outboundDetour": [
    {
      "protocol": "freedom",
      "settings": {},
      "tag": "direct"
    }
  ],
  "dns": {
    "servers": [
      "8.8.8.8",
      "8.8.4.4",
      "localhost"
    ]
  },
  "routing": {
    "strategy": "rules",
    "settings": {
      "domainStrategy": "IPIfNonMatch",
      "rules": [
        {
          "type": "field",
          "port": "1-52",
          "outboundTag": "direct"
        },
        {
          "type": "field",
          "port": "54-79",
          "outboundTag": "direct"
        },
        {
          "type": "field",
          "port": "81-442",
          "outboundTag": "direct"
        },
        {
          "type": "field",
          "port": "444-65535",
          "outboundTag": "direct"
        },
        {
          "type": "field",
          "domain": ["geosite:cn"],
          "outboundTag": "direct"
        },
        {
          "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",
            "geoip:cn"
          ],
          "outboundTag": "direct"
        }
      ]
    }
  }
}

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

服务器端错误日志:
2017/11/21 18:35:19 [Warning]Core: V2Ray started
2017/11/24 08:55:00 [Warning]Core: V2Ray started
2017/11/24 08:55:52 [Warning]Core: V2Ray started
2017/11/24 08:57:03 [Warning]Core: V2Ray started
2017/11/24 08:59:01 [Warning]Core: V2Ray started
2017/11/26 22:17:16 [Warning]Core: V2Ray started
2017/11/27 13:02:35 [Warning]Core: V2Ray started
客户端错误日志:
V2Ray v2.51.2 (One for all) 20171126
An unified platform for anti-censorship.
2017/11/27 15:59:02 [Debug]App|Proxyman|Inbound: creating tcp worker on 127.0.0.1:1081
2017/11/27 15:59:02 [Warning]Core: V2Ray started
2017/11/27 16:06:17 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > websocket: close 1006 (abnormal closure): unexpected EOF
2017/11/27 16:19:39 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > websocket: close 1006 (abnormal closure): unexpected EOF
2017/11/27 16:24:13 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > websocket: close 1006 (abnormal closure): unexpected EOF
2017/11/27 16:25:40 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > context canceled
2017/11/27 16:26:48 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > context canceled
2017/11/27 16:32:31 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > context canceled2017/11/27 16:37:14 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > websocket: close 1006 (abnormal closure): unexpected EOF
2017/11/27 16:38:32 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > context canceled
2017/11/27 16:39:24 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > context canceled
2017/11/27 16:42:14 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > websocket: close 1006 (abnormal closure): unexpected EOF
2017/11/27 16:45:46 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > websocket: close 1006 (abnormal closure): unexpected EOF
2017/11/27 16:46:52 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > websocket: close 1006 (abnormal closure): unexpected EOF
2017/11/27 16:47:07 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > websocket: close 1006 (abnormal closure): unexpected EOF
2017/11/27 16:47:49 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: connection ends > websocket: close 1006 (abnormal closure): unexpected EOF

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

2017/11/21 18:35:19 [Warning]Core: V2Ray started
2017/11/24 08:55:00 [Warning]Core: V2Ray started
2017/11/24 08:55:52 [Warning]Core: V2Ray started
2017/11/24 08:57:03 [Warning]Core: V2Ray started
2017/11/24 08:59:01 [Warning]Core: V2Ray started
2017/11/26 22:17:16 [Warning]Core: V2Ray started
2017/11/27 13:02:35 [Warning]Core: V2Ray started
SacredOath commented 6 years ago

刚刚试验了一下,如果是通过SStap连接socks5,开启全局代理,上诉软件可以同时使用.请问是不是socks5同一端口只能同时连接一个程序?

betterdoitnow commented 6 years ago

没这个说法啊,我这边也用Dropbox,刚刚试了一下上传时打开网页,一切正常

DarienRaymond commented 6 years ago

从log看并没有问题,请检查你的nginx日志,看一下是不是有什么连接被拒绝了。

SacredOath commented 6 years ago

应该是线路问题,现在可以同时chrome+SwitchyOmega,Dropbox,Telegram运行. 可能是ISP针对限流,的确不关v2ray的事.

k79e commented 4 years ago

我最近也出这个问题了 不清楚是为什么 只是会卡一下 然后正常