Jrohy / trojan

trojan多用户管理部署程序, 支持web页面管理
GNU General Public License v3.0
5.4k stars 1.52k forks source link

Source code statistics traffic problem #840

Closed liuchengts closed 8 months ago

liuchengts commented 8 months ago

question: I'm reading the source code of this project and want to develop new features, but I can't find anything related to writing the traffic used by users to the database.

Please tell me how to implement traffic statistics for each user on Trojan? Do you need to use Trojan API?

Supplement: On v2ray, each user has an independent port, so I used iptables combined with periodic scheduled tasks to implement it. However, the trojan ports are all 443. Obviously this solution will not work.

liuchengts commented 8 months ago

I found the answer on this page。https://p4gefau1t.github.io/trojan-go/basic/full-config/

image