Cenmrev / V2RayX

GUI for v2ray-core on macOS
GNU General Public License v3.0
7.61k stars 1.14k forks source link

v2rayX支持 ws+tls+web(https)模式吗?怎么设置都连不上 #214

Open flukaxkx opened 5 years ago

flukaxkx commented 5 years ago

请回答下列问题。不按模板发的 issue 将直接被关闭。

0) 如果你没有遇到任何错误和不正常,请在此处回答你想发表的内容: ws+tls+web(https) 不能联网 web服务器使apache v2rayX 采用的是 全局+main的模式。

1) 你正在使用哪个版本的 V2RayX,你的 macOS 系统版本? macOS X 10.13.6 在vmware 虚拟机上安装,桥接模式

2) 如果你在操作 V2RayX 的时候遇到程序崩溃/无反应,请描述你的操作,之后在命令行(终端.app)里运行/Applications/V2RayX.app/Contents/MacOS/V2RayX,重复上述操作直至软件崩溃,把终端里的输出贴到下面指定的地方。

在这里贴上终端的输出

3) 如果 V2RayX 没有发生崩溃,但是有一些不正常行为,比如上次勾选了 mux,再次打开,mux 的钩没有了。请描述你遇到的不正常行为。

4) 如果 V2RayX 一切正常,但网络依然不如你所预料,请首先把 log level 切换到 debug,再次访问你想访问的网站。然后点击 V2RayX 的 view current config.json,将弹出的浏览器内的配置文件粘贴到下面指定的地方,但是隐藏掉ip/端口/id等信息。

{
  "dns" : {
    "servers" : [
      "8.8.8.8",
      "8.8.4.4",
      "localhost"
    ]
  },
  "inbounds" : [
    {
      "listen" : "127.0.0.1",
      "port" : 1081,
      "protocol" : "socks",
      "tag" : "socksinbound",
      "settings" : {
        "auth" : "noauth",
        "udp" : false,
        "ip" : "127.0.0.1"
      }
    },
    {
      "listen" : "127.0.0.1",
      "port" : 8001,
      "protocol" : "http",
      "tag" : "httpinbound",
      "settings" : {
        "timeout" : 0
      }
    }
  ],
  "outbounds" : [
    {
      "sendThrough" : "0.0.0.0",
      "mux" : {
        "enabled" : false,
        "concurrency" : 8
      },
      "protocol" : "vmess",
      "settings" : {
        "vnext" : [
          {
            "address" : "abc",
            "users" : [
              {
                "id" : "xxx",
                "alterId" : 64,
                "security" : "chacha20-poly1305",
                "level" : 1
              }
            ],
            "port" : 443
          }
        ]
      },
      "tag" : "SCI",
      "streamSettings" : {
        "wsSettings" : {
          "path" : "\/ooo",
          "headers" : {

          }
        },
        "quicSettings" : {
          "key" : "",
          "security" : "none",
          "header" : {
            "type" : "none"
          }
        },
        "tlsSettings" : {
          "allowInsecure" : true,
          "alpn" : [
            "http\/1.1"
          ],
          "serverName" : "abc",
          "allowInsecureCiphers" : false
        },
        "httpSettings" : {
          "path" : ""
        },
        "kcpSettings" : {
          "header" : {
            "type" : "none"
          },
          "mtu" : 1350,
          "congestion" : false,
          "tti" : 20,
          "uplinkCapacity" : 5,
          "writeBufferSize" : 1,
          "readBufferSize" : 1,
          "downlinkCapacity" : 20
        },
        "tcpSettings" : {
          "header" : {
            "type" : "none"
          }
        },
        "security" : "tls",
        "network" : "ws"
      }
    }
  ],
  "routing" : {
    "name" : "all_to_main",
    "domainStrategy" : "AsIs",
    "rules" : [
      {
        "type" : "field",
        "outboundTag" : "SCI",
        "port" : "0-65535"
      }
    ]
  },
  "log" : {
    "error" : "\/var\/folders\/q3\/cpsx8wvx6_j43kh39vs0hlyr0000gn\/T\/cenmrev.v2rayx.log\/error.log",
    "loglevel" : "debug",
    "access" : "\/var\/folders\/q3\/cpsx8wvx6_j43kh39vs0hlyr0000gn\/T\/cenmrev.v2rayx.log\/access.log"
  }
}

然后点击 V2RayX 的view log,把 error.log 中的输出贴到下方:

2019/01/24 04:06:17 [Debug] v2ray.com/core/app/log: Logger started
2019/01/24 04:06:17 [Warning] v2ray.com/core: V2Ray 4.9.0 started
2019/01/24 04:06:23 [Debug] v2ray.com/core/app/log: Logger started
2019/01/24 04:06:23 [Warning] v2ray.com/core: V2Ray 4.9.0 started
2019/01/24 04:07:13 [Info] [2997625060] v2ray.com/core/proxy/socks: TCP Connect request to tcp:www.google.com:443
2019/01/24 04:07:13 [Info] [2997625060] v2ray.com/core/app/dispatcher: taking detour [SCI] for [tcp:www.google.com:443]
2019/01/24 04:07:13 [Info] [2997625060] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:07:16 [Info] [2997625060] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:www.google.com:443 via tcp:abc.abc:443
2019/01/24 04:07:31 [Info] [2997625060] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > websocket: close 1000 (normal)
2019/01/24 04:07:31 [Info] [2997625060] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > v2ray.com/core/proxy/socks: failed to transport all TCP response > io: read/write on closed pipe
2019/01/24 04:07:31 [Info] [1197276169] v2ray.com/core/proxy/socks: TCP Connect request to tcp:www.google.com:443
2019/01/24 04:07:31 [Info] [1197276169] v2ray.com/core/app/dispatcher: taking detour [SCI] for [tcp:www.google.com:443]
2019/01/24 04:07:31 [Info] [1197276169] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:07:34 [Info] [1197276169] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:www.google.com:443 via tcp:abc.abc:443
2019/01/24 04:07:49 [Info] [1197276169] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > websocket: close 1000 (normal)
2019/01/24 04:07:49 [Info] [1197276169] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > v2ray.com/core/proxy/socks: failed to transport all TCP response > io: read/write on closed pipe
2019/01/24 04:07:49 [Info] [3182629428] v2ray.com/core/proxy/socks: TCP Connect request to tcp:www.google.com:443
2019/01/24 04:07:49 [Info] [3182629428] v2ray.com/core/app/dispatcher: taking detour [SCI] for [tcp:www.google.com:443]
2019/01/24 04:07:49 [Info] [3182629428] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:07:50 [Info] [2180629835] v2ray.com/core/proxy/socks: TCP Connect request to tcp:www.google.com:443
2019/01/24 04:07:50 [Info] [2180629835] v2ray.com/core/app/dispatcher: taking detour [SCI] for [tcp:www.google.com:443]
2019/01/24 04:07:50 [Info] [2180629835] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:07:51 [Info] [3182629428] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:07:51 [Info] [3182629428] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled
2019/01/24 04:07:51 [Info] [3182629428] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:07:51 [Info] [3182629428] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:07:52 [Info] [3182629428] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:07:53 [Warning] [3182629428] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://abc.abc/kkk):  > dial tcp: operation was canceled] > v2ray.com/core/common/retry: all retry attempts failed
2019/01/24 04:07:56 [Info] [2180629835] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:www.google.com:443 via tcp:abc.abc:443
2019/01/24 04:08:12 [Info] [2180629835] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > websocket: close 1000 (normal)
2019/01/24 04:08:12 [Info] [2180629835] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > v2ray.com/core/proxy/socks: failed to transport all TCP response > io: read/write on closed pipe
2019/01/24 04:08:47 [Info] [1486170813] v2ray.com/core/proxy/http: request to Method [CONNECT] Host [www.google.com:443] with URL [//www.google.com:443]
2019/01/24 04:08:47 [Info] [1486170813] v2ray.com/core/app/dispatcher: taking detour [SCI] for [tcp:www.google.com:443]
2019/01/24 04:08:47 [Info] [1486170813] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:08:50 [Info] [1486170813] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:www.google.com:443 via tcp:abc.abc:443
2019/01/24 04:09:05 [Info] [1486170813] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > websocket: close 1000 (normal)
2019/01/24 04:09:05 [Info] [1486170813] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/http: connection ends > io: read/write on closed pipe
2019/01/24 04:09:05 [Info] [2281102611] v2ray.com/core/proxy/http: request to Method [CONNECT] Host [www.google.com:443] with URL [//www.google.com:443]
2019/01/24 04:09:05 [Info] [2281102611] v2ray.com/core/app/dispatcher: taking detour [SCI] for [tcp:www.google.com:443]
2019/01/24 04:09:05 [Info] [2281102611] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:09:13 [Info] [2281102611] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:09:19 [Info] [2281102611] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:www.google.com:443 via tcp:abc.abc:443
2019/01/24 04:09:28 [Info] [3487298917] v2ray.com/core/proxy/http: request to Method [CONNECT] Host [www.google.com:443] with URL [//www.google.com:443]
2019/01/24 04:09:28 [Info] [3487298917] v2ray.com/core/app/dispatcher: taking detour [SCI] for [tcp:www.google.com:443]
2019/01/24 04:09:28 [Info] [3487298917] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:09:29 [Info] [3487298917] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:www.google.com:443 via tcp:abc.abc:443
2019/01/24 04:09:29 [Info] [2281102611] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
2019/01/24 04:09:29 [Info] [2281102611] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/http: connection ends > context canceled
2019/01/24 04:09:44 [Info] [3487298917] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > websocket: close 1000 (normal)
2019/01/24 04:09:44 [Info] [3487298917] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/http: connection ends > io: read/write on closed pipe
2019/01/24 04:09:44 [Info] [759481565] v2ray.com/core/proxy/http: request to Method [CONNECT] Host [www.google.com:443] with URL [//www.google.com:443]
2019/01/24 04:09:44 [Info] [759481565] v2ray.com/core/app/dispatcher: taking detour [SCI] for [tcp:www.google.com:443]
2019/01/24 04:09:44 [Info] [759481565] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:09:48 [Info] [759481565] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:09:48 [Info] [759481565] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/http: connection ends > context canceled
2019/01/24 04:09:49 [Info] [759481565] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:09:49 [Info] [759481565] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:09:50 [Info] [759481565] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:09:51 [Warning] [759481565] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://abc.abc/kkk):  > dial tcp: operation was canceled] > v2ray.com/core/common/retry: all retry attempts failed
2019/01/24 04:10:36 [Info] [2907920927] v2ray.com/core/proxy/http: request to Method [CONNECT] Host [valid.apple.com:443] with URL [//valid.apple.com:443]
2019/01/24 04:10:36 [Info] [2907920927] v2ray.com/core/app/dispatcher: taking detour [SCI] for [tcp:valid.apple.com:443]
2019/01/24 04:10:36 [Info] [2907920927] v2ray.com/core/transport/internet/websocket: creating connection to tcp:abc.abc:443
2019/01/24 04:10:42 [Info] [2907920927] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:valid.apple.com:443 via tcp:abc.abc:443
2019/01/24 04:11:42 [Info] [2907920927] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/http: connection ends > context canceled
2019/01/24 04:11:42 [Info] [2907920927] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled

5) 其他你认为可以帮助开发者和你一起解决问题的信息: 这是我win下的配置信息,在v2rayN下好用:

{
  "log": {
    "access": "./log/abc.access.log",
    "error": "./log/abc.error.log",
    "loglevel": "debug"
  },
  "inbound": {
    "port": 1081,
    "listen": "0.0.0.0",
    "protocol": "socks",
    "settings": {
      "auth": "noauth",
      "udp": true,
      "ip": "127.0.0.1",
      "clients": null
    },
    "streamSettings": null
  },
  "outbound": {
    "tag": "agentout",
    "protocol": "vmess",
    "settings": {
      "vnext": [
        {
          "address": "abc.abc",
          "port": 443,
          "users": [
            {
              "id": "xxx",
              "alterId": 64,
              "security": "chacha20-poly1305"
            }
          ]
        }
      ],
      "servers": null
    },
    "streamSettings": {
      "network": "ws",
      "security": "tls",
      "tcpSettings": null,
      "kcpSettings": null,
      "tlsSettings":{
        "serverName":"abc.abc",
        "allowInsecure":true
      },
      "wsSettings": {
        "connectionReuse": true,
        "path": "/ooo",
        "headers": null
      }
    },
    "mux": {
      "enabled": true
    }
  },
  "inboundDetour": null,
  "outboundDetour": [
    {
      "protocol": "freedom",
      "settings": {
        "response": null
      },
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "settings": {
        "response": {
          "type": "http"
        }
      },
      "tag": "blockout"
    }
  ],
  "dns": {
    "servers": [
      "8.8.8.8",
      "8.8.4.4",
      "localhost"
    ]
  },
  "routing": {
    "strategy": "rules",
    "settings": {
      "domainStrategy": "IPIfNonMatch",
      "rules": [
        {
          "type": "field",
          "port": null,
          "outboundTag": "direct",
          "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"
          ],
          "domain": null
        }
      ]
    }
  }
}

这是我服务器的配置信息

{
  "log" : {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbound": {
    "port": 12345,
    "listen":"127.0.0.1",
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "xxx",
          "level": 1,
          "alterId": 64
        }
      ]
    },
    "streamSettings": {
      "network": "ws",
      "wsSettings": {
        "path":"/ooo"
      }
    }
  },
  "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"
        }
      ]
    }
  }
}
Chandler-Lu commented 5 years ago

支持

flukaxkx commented 5 years ago

又仔细对了一下win下颌mac下的配置文件: 第一, win下都是:“inbound”,“outbound” mac下是:“inbounds”,“outbounds”

第二, mac下多了http(s)代理,我记得socks不是可以代理所有的流量吗? 弄两个代理会不会有影响呢?

第三,

          "alpn" : [
            "http\/1.1"
          ],

这段是什么意思啊,win下没有这个东西啊。

第四,ws字段也有不同,上面的是mac的,下面的是win的 这个会不会影响使用啊。

        "wsSettings" : {
          "path" : "\/ooo",
          "headers" : {

          }
        },
      "wsSettings": {
        "connectionReuse": true,
        "path": "/ooo",
        "headers": null
      }
flukaxkx commented 5 years ago

删去最新的v2rayx,装上早年的1.1.0版本,就好用了。 难道真是版本的问题?

1.1.0自动生成的config.json如下:

{
  "policy" : {
    "levels" : {
      "0" : {
        "uplinkOnly" : 0
      }
    }
  },
  "dns" : {
    "servers" : [
      "8.8.8.8",
      "8.8.4.4",
      "localhost"
    ]
  },
  "outboundDetour" : [
    {
      "protocol" : "freedom",
      "tag" : "direct",
      "settings" : {

      }
    }
  ],
  "inbound" : {
    "listen" : "127.0.0.1",
    "port" : 1081,
    "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" : 8001,
      "protocol" : "http",
      "tag" : "httpDetour",
      "domainOverride" : [
        "http",
        "tls"
      ],
      "streamSettings" : {

      },
      "settings" : {
        "timeout" : 0
      }
    }
  ],
  "log" : {
    "error" : "\/var\/folders\/q3\/cpsx8wvx6_j43kh39vs0hlyr0000gn\/T\/cenmrev.v2rayx.log.x\/error.log",
    "loglevel" : "debug",
    "access" : "\/var\/folders\/q3\/cpsx8wvx6_j43kh39vs0hlyr0000gn\/T\/cenmrev.v2rayx.log.x\/access.log"
  },
  "routing" : {
    "strategy" : "rules",
    "settings" : {
      "domainStrategy" : "IPIfNonMatch",
      "rules" : [
        {
          "domain" : [
            "localhost"
          ],
          "type" : "field",
          "outboundTag" : "direct"
        },
        {
          "type" : "field",
          "outboundTag" : "direct",
          "ip" : [
            "geoip:private"
          ]
        }
      ]
    }
  },
  "outbound" : {
    "sendThrough" : "0.0.0.0",
    "mux" : {
      "enabled" : false,
      "concurrency" : 8
    },
    "protocol" : "vmess",
    "settings" : {
      "vnext" : [
        {
          "address" : "abc.abc",
          "port" : 443,
          "users" : [
            {
              "id" : "xxx",
              "alterId" : 64,
              "security" : "chacha20-poly1305",
              "level" : 1
            }
          ],
          "remark" : ""
        }
      ]
    },
    "streamSettings" : {
      "wsSettings" : {
        "path" : "\/ooo",
        "headers" : {

        }
      },
      "tlsSettings" : {
        "serverName" : "abc.abc",
        "allowInsecure" : true
      },
      "httpSettings" : {
        "path" : "",
        "host" : [
          ""
        ]
      },
      "tcpSettings" : {
        "header" : {
          "type" : "none"
        }
      },
      "kcpSettings" : {
        "header" : {
          "type" : "none"
        },
        "mtu" : 1350,
        "congestion" : false,
        "tti" : 50,
        "uplinkCapacity" : 5,
        "writeBufferSize" : 1,
        "readBufferSize" : 2,
        "downlinkCapacity" : 20
      },
      "network" : "ws",
      "security" : "tls"
    }
  }
}
Chandler-Lu commented 5 years ago

很明显你win的配置文件已经是老版本的配置了,根据v2ray项目的说法应该很快不被支持,新版的config文件已经将inboundsoutbounds全部改为了数组。 从v2ray-core项目的issue来看,客户端使用ws+tls的新配置而服务端仍然使用老版本+旧配置有无法连接的反馈,建议将服务端更新为新版config文件,同时更新客户端和服务端core至最新版

flukaxkx commented 5 years ago

好的,多谢,我正在看新版的文档,尽快更新一下。