Shadowsocks Statistics
This is a python script for analyzing log generated by shadowsocks. It lets you know where the traffic is going.
Installation
No installation is needed. Just run everything from the project directory.
Usage
The log file is usually located at /var/log/shadowsocks.log
on the machine where the server is running. For analysis, you must obtain a copy and put it under your working directory.
A few examples on how to use the script:
Get server time based analysis with resolution of hour(-g h) in verbose mode (-v)
python analyze.py get_stats_by_time -g h -v
Get server time based analysis with resolution of day(-g D) in verbose mode (-v)
python analyze.py get_stats_by_time -g D -v
Find out what domain names are more closely related in time. This will produce a pdf file in the same directory.
python similarity_analyze.py
Get overview of client connection activities.
python analyze.py show_ips
Find client IP based statistics, wildcard is supported.
python analyze.py get_stats_by_ip --client_ip *.*.*.*
For more information, run
python analyze.py -h
Dependencies
This software requres a graph visualization library called graph-tool, which can be found at https://graph-tool.skewed.de/ In this folder, install_dep_ubuntu is used to install the graph-tool dependency on the Ubuntu system. Matplotlib is needed for visualization. You may need to install any packages according to system information.