Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eycorsican/aa8cdc1d39c3fa355c499f89a15b9753 to your computer and use it in GitHub Desktop.
Save eycorsican/aa8cdc1d39c3fa355c499f89a15b9753 to your computer and use it in GitHub Desktop.
{
"stats": {},
"api": {
"services": [
"StatsService"
],
"tag": "api"
},
"policy": {
"levels": {
"0": {
"connIdle": 300,
"downlinkOnly": 30,
"handshake": 4,
"uplinkOnly": 5,
"statsUserDownlink": true,
"statsUserUplink": true
}
}
},
"inbound": {
"port": 8002,
"protocol": "vmess",
"settings": {
"clients": [
{
"alterId": 64,
"email": "123@gmail.com",
"id": "e731f153-4f31-49d3-9e8f-ff8f396135ef",
"level": 0
}
],
"disableInsecureEncryption": true
},
"streamSettings": {
"network": "tcp"
}
},
"inboundDetour": [
{
"listen": "127.0.0.1",
"port": 10085,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
}
],
"outbound": {
"protocol": "freedom",
"settings": {}
},
"routing": {
"settings": {
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
}
]
},
"strategy": "rules"
}
}
@malongmedea
Copy link

配置啥的啥问题,为啥总是显示无法查看
v2ray.com/core/infra/control: failed to dial 127.0.0.1:10085 > context deadline exceeded
我10085也是监听的

相同的问题,你解决了吗

我也遇到了相同的问题,你们解决了吗?

@malongmedea
Copy link

我发现问题了,我使用了别人的配置文件,没注意到routing配置中有一条"127.0.0.0/8"的blocked规则。将其删除就可以正常统计了

@rayguo17
Copy link

这个问题,是不是可以单独发个issue啊

配置啥的都没啥问题,为啥总是显示无法连通 v2ray.com/core/infra/control: failed to dial 127.0.0.1:10085 > context deadline exceeded 我看10085端口也是listen的

这个问题有没有单独的issue啊。我的配置里面没有block的规则,但还是不行。但我使用的是v2ray api stats 显示
root@butler-virtual-machine:/etc/resolvconf/resolv.conf.d# v2ray api stats
failed to dial 127.0.0.1:8080

@hnyyghk
Copy link

hnyyghk commented Oct 27, 2022

这个问题,是不是可以单独发个issue啊

配置啥的都没啥问题,为啥总是显示无法连通 v2ray.com/core/infra/control: failed to dial 127.0.0.1:10085 > context deadline exceeded 我看10085端口也是listen的

这个问题有没有单独的issue啊。我的配置里面没有block的规则,但还是不行。但我使用的是v2ray api stats 显示 root@butler-virtual-machine:/etc/resolvconf/resolv.conf.d# v2ray api stats failed to dial 127.0.0.1:8080

你这个报错应该是端口号不对,默认端口8080,要加上--server=127.0.0.1:10085,命令用法也有变化

$ v2ray api stats --server=127.0.0.1:10085
Value Name
1 1.59KB inbound>>>api>>>traffic>>>downlink
2 2.97KB inbound>>>api>>>traffic>>>uplink
3 196.23KB inbound>>>vmess-ws>>>traffic>>>downlink
4 66.02KB inbound>>>vmess-ws>>>traffic>>>uplink
5 182.23KB user>>>love@v2ray.com>>>traffic>>>downlink
6 49.75KB user>>>love@v2ray.com>>>traffic>>>uplink

Total: 498.78KB

$ v2ray api stats --server=127.0.0.1:10085 StatsService.GetStats 'inbound>>>vmess-ws>>>traffic>>>uplink'
Value Name
1 39.59KB inbound>>>vmess-ws>>>traffic>>>uplink

Total: 39.59KB

@rayguo17
Copy link

这个问题,是不是可以单独发个issue啊

配置啥的都没啥问题,为啥总是显示无法连通 v2ray.com/core/infra/control: failed to dial 127.0.0.1:10085 > context deadline exceeded 我看10085端口也是listen的

这个问题有没有单独的issue啊。我的配置里面没有block的规则,但还是不行。但我使用的是v2ray api stats 显示 root@butler-virtual-machine:/etc/resolvconf/resolv.conf.d# v2ray api stats failed to dial 127.0.0.1:8080

你这个报错应该是端口号不对,默认端口8080,要加上--server=127.0.0.1:10085,命令用法也有变化

$ v2ray api stats --server=127.0.0.1:10085 Value Name 1 1.59KB inbound>>>api>>>traffic>>>downlink 2 2.97KB inbound>>>api>>>traffic>>>uplink 3 196.23KB inbound>>>vmess-ws>>>traffic>>>downlink 4 66.02KB inbound>>>vmess-ws>>>traffic>>>uplink 5 182.23KB user>>>love@v2ray.com>>>traffic>>>downlink 6 49.75KB user>>>love@v2ray.com>>>traffic>>>uplink

Total: 498.78KB

$ v2ray api stats --server=127.0.0.1:10085 StatsService.GetStats 'inbound>>>vmess-ws>>>traffic>>>uplink' Value Name 1 39.59KB inbound>>>vmess-ws>>>traffic>>>uplink

Total: 39.59KB

后面解决了,问题如下:
{ "stats": {}, "log": { "loglevel": "debug" }, "api": { "tag": "api", "services": [ "HandlerService", "LoggerService", "StatsService" //开启了stats服务,但是后面的policy,system没有设置 ] }, "policy": { "levels": { "0": { "statsUserUplink": true, "statsUserDownlink": true }, "1": { "statsUserUplink": true, "statsUserDownlink": true } }, "system": { "statsInboundUplink": true, "statsInboundDownlink": true //这里没有设置 } }, }
https://guide.v2fly.org/advanced/traffic.html#%E9%85%8D%E7%BD%AE%E7%BB%9F%E8%AE%A1%E5%8A%9F%E8%83%BD
参考上面的链接的“配置统计功能”一栏,要按着里面的配置操作,才能顺利运行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment