v2ray / v2ray-core

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

API 无响应,请问是否不支持TLS+WS模式 #1216

Closed 5high closed 6 years ago

5high commented 6 years ago

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明) v3.33

2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。 TLS+WS 正常工作

3) 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等) API 取回 用户流量信息没返回结果

/usr/bin/v2ray/v2ctl api --server=127.0.0.1:10010 StatsService.GetStats 'name: "user>>>test@test.com>>>traffic>>>downlink" reset: false'

这条命令执行完毕后会一直卡在命令提示符,没有超时,也没有返回信息。

4) 你期待看到的正确表现是怎样的? API能正常返回用户流量

5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

// 在这里附上服务器端配置文件
{
    "log": {
        "loglevel": "debug"
    },
    "stats": {},
    "api": {
        "services": [
            "StatsService",
        "HandlerService"
        ],
        "tag": "api"
    },
    "policy": {
        "levels": {
            "0": {
                "connIdle": 300,
                "downlinkOnly": 30,
                "handshake": 4,
                "uplinkOnly": 5,
                "statsUserDownlink": true,
                "statsUserUplink": true
            }
        }
    },
    "inbound": {
        "port": 10000,
        "listen": "127.0.0.1",
        "protocol": "vmess",
        "settings": {
            "clients": [
                {
                    "id": "UUID",
                    "alterId": 64,
            "level": 0,
            "email": "test1@test.com"
                },
                {
                    "id": "UUID2",
                    "alterId": 64,
            "level": 0,
            "email": "test2@test.com"
                },
                {
                    "id": "UUID3",
                    "alterId": 64,
                    "level": 0,
                    "email": "test@test.com"
                }
            ]
        },
        "inboundDetour": [
            {
                "listen": "127.0.0.1",
                "port": 10010,
                "protocol": "dokodemo-door",
                "settings": {
                    "address": "127.0.0.1"
                },
                "tag": "api"
            }
        ],
        "streamSettings": {
            "network": "ws",
            "wsSettings": {
                "path": "/play"
            }
        }
    },
    "outbound": {
        "protocol": "freedom",
        "settings": {}
    },
    "routing": {
        "strategy": "rules",
        "settings": {
            "rules": [
                {
                    "inboundTag": [
                        "api"
                    ],
                    "outboundTag": "api",
                    "type": "field"
                }
            ]
        }
    }
}
客户端配置:

// 在这里附上客户端配置
{
  "log": {
    "loglevel": "debug"
  },
  "inbound": {
    "port": 1080,
    "listen": "127.0.0.1",
    "protocol": "socks",
    "settings": {
      "auth": "noauth",
      "udp": true
    }
  },

  "outbound": {
    "mux": {"enabled": true},
    "tag":"proxy",
    "protocol": "vmess",
    "settings": {
      "vnext": [
        {
          "address": "xxx.com",
          "port": 443,
          "users": [
            {
              "id": "UUID",
              "alterId": 64
            }
          ]
        }
      ]
    },
    "streamSettings": {
      "network": "ws",
      "security": "tls",
      "tlsSettings": {
        "serverName": "xxx.com"
      },
      "wsSettings": {
        "path": "/play"
      }
    }
  },
"outboundDetour": [
  {
   "tag": "direct", 
   "protocol": "freedom", 
   "settings": {
    "response": null
   }
  }, 
  {
   "tag": "blockout", 
   "protocol": "blackhole", 
   "settings": {
    "response": {
     "type": "http"
    }
   }
  }
 ],  
 "dns": {
  "servers": [
   "8.8.8.8", 
   "8.8.4.4", 
   "localhost"
  ]
 },
  "routing": {
  "settings": {
   "rules": [
    {
          "type": "field",
          "domain": [
            "www.google.com.hk",
        "googleapis.cn",
        "google.cn",
        "ggpht.cn",
        "chrome.google.com",
        "googleusercontent.com",
        "android.clients.google.com",
        "xn--ngstr-lra8j.com"
          ],
          "outboundTag": "proxy"
    },
    {
     "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, 
     "type": "field", 
     "port": null, 
     "outboundTag": "direct"
    }, 
    {
     "type": "chinaip", 
     "outboundTag": "direct"
    }, 
    {
     "type": "chinasites", 
     "outboundTag": "direct"
    }
   ], 
   "domainStrategy": "IPIfNonMatch"
  }, 
  "strategy": "rules"
 } 

}

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

服务器端错误日志:
   并无错误日志
客户端错误日志:
    并无错误日志

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


    并无错误日志
VictoriaRaymond commented 6 years ago

v2ctl api 只支持TCP连接,其它的transport都不支持。