-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: Add user IPs and access times tracking #4360
Conversation
… IPs and access times.
…elated gRPC response.
…nd_grpc.pb.go. Added google timestamp.proto
应当把它放在 command 文件夹下面并把 metadata 改为 Xray 的,还有这个文件复制进来没有 license 问题吧 |
你改好后,这个 PR 我来合并(时机成熟时,现在 main 在搞 MMDF) |
Guys please don't copy protobuf code in project. |
@yuhan6665 I did that last time, but my PR was canceled: #4347 |
可以换成自定义的结构吗?不引用外部 proto |
Yes, i can do it. I'll just say it again, @yuhan6665 told me to use google protobuf, so that's what I did... |
Please don't define your own timestamp, use protobuf version, properly. |
@yuhan6665 like I did last time, right? #4347 |
我不太了解 proto 这里是怎么回事 那如果引用外部 proto,执行 |
@RPRX It turns out that it is... |
所以 google standard timestamp 有什么特别的好处吗?我们不是只需要 timestamp 的值而已? |
Initially, I just did the display in seconds, but I was told to use google timestamp. I did so, everything was accepted, but there was a rollback due to the lack of file data during execution: |
我想了解下 @yuhan6665 的看法,或许这里我们只是需要一个值? |
如果需要先拉下来外部 proto 就比较难受了,我经常 |
Using google protobuf is not rocket science, I'm sure we (whoever run into issue) can fix it. |
既然没有特别的需求,直接拿个 uint64 存 timestamp 吧 |
So I'm just returning the timestamp in uint64? |
timestamp轻松加愉快为什么要搞个这个东西进来 |
No no, I'll just return the timestamp (uint64), okey? |
|
@mr1cloud just uint64 |
…d update related code to use uint64 for IP timestamps.
Okay, I think that's it. Execute:
Result: {
"ips": {
"192.168.1.2": 1738924438
},
"name": "user>>>user1>>>online"
}
|
改成 int64 吧,不用转换类型了 |
Added IpTimeMap method, GetStatsOnlineIpList RPC and CLI command for tracking client IPs and access times.
Execute:
Result:
New PR after corrections from #4347