Skip to content
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

shadowsocks 流量统计 #85

Open
ftao opened this issue Jul 18, 2015 · 6 comments
Open

shadowsocks 流量统计 #85

ftao opened this issue Jul 18, 2015 · 6 comments

Comments

@ftao
Copy link
Owner

ftao commented Jul 18, 2015

方案1:

  1. 修改 ss-server 吐出对应的日志 或者 udp 包
  2. 发送到统计服务器

方案2:

  1. 使用IPTABLE 统计流量
  2. 定期发送到统计服务器

问题:
是否可以统计 连接到服务器 / 客户端IP ? 来检测/限制客户端数目。

@vmlinz
Copy link
Contributor

vmlinz commented Jul 18, 2015

方案1的实现:
shadowsocks 修改 https://github.com/mengskysama/shadowsocks/tree/manyuser
对应的前端 https://github.com/wzxjohn/moeSS
对应的前端 https://github.com/orvice/ss-panel

方案2的实现:
https://github.com/GameXG/shadowsocks_admin

我更喜欢iptables的那种,实现起来更加灵活。可以将用户管理和shaodowsocks配置,流量管理解藕。
可以用shadowsocks的多端口模式运行,再在user model里面将一个具体的配置(ip,port,password)和一个user绑定。

在shadowsocks slave node上用iptables实现对端口的流量信息统计,再通过rabbitmq之类的直接加密发送至统计服务器master node。基本就是一个custom的radius实现。。。大概也可以在客户端通过端口反查出用户,然后直接用radius客户端发送用户和流量信息至radius服务器。

我现在也在设计一套简单可用的shadowsocks服务设施,希望可以和你多多交流,呵呵

@ftao
Copy link
Owner Author

ftao commented Jul 19, 2015

我也觉得不要修改ss, 即使要修改也要保证协议兼容。

@humiaozuzu
Copy link

@ftao 第二个方案的坏处也很明显,isp 会对非常用端口进行限速,所以都用一个常用的端口,流量上更有保障一些

@jackjm
Copy link

jackjm commented Nov 7, 2015

https://github.com/shadowsocks/shadowsocks/wiki/Manage-Multiple-Users
If you want to build a user management system, Shadowsocks provides an API that allows you to add/remove ports on the fly, as well as get transfer statistics from Shadowsocks.

@ftao
Copy link
Owner Author

ftao commented Nov 8, 2015

cool. I was not aware of this feature ..
@jackjm thanks for the link .

@vmlinz
Copy link
Contributor

vmlinz commented Nov 8, 2015

@jackjm Thanks for mentioning it. It's really cool. Seems libev implementation has this feature too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants