/SSRSpeed

ShadowsocksR Batch Speed Tool

Primary LanguagePythonGNU General Public License v3.0GPL-3.0


SSRSpeed

Batch speed measuring tool based on Shadowsocks(R)

GitHub tag (latest SemVer) GitHub release

Links

Important Hint

Before you publicly release your speed test results, be sure to ask the node owner if they agree to the release to avoid unnecessary disputes.

  • SpeedTestNet and Fast.com is no longer supported.
  • MacOS has not found a suitable way to detect libsodium, so be sure to ensure that libsodium is installed before testing nodes that use encryption methods such as chacha20.
  • Shadowsocks-libev and Simple-Obfs are recommended to be installed using a compiled installation. It is known that the Shadowsocks-libev version in the Debian repository is too low to use some new encryption methods.
  • If your hostname has non-ASCII characters, Web-UI will not work.

Features

  • Support SpeedTestNet, Fast.com and socket download.
  • Support for exporting result as json and png.
  • Support batch import of configuration from GUI configuration file and SSPanel-v2, v3 subscription link.
  • Support for importing data from any Json export file and re-exporting files of the specified format.
  • Support WebUI

Requirements

Universal dependency

  • Python >= 3.6
  • pillow
  • requests
  • pysocks
  • flask
  • flask-cors
  • pyyaml

Linux dependency

Platform Support

  1. Windows 10 x64
  2. Ubuntu 18.04 LTS
  3. MacOS

Getting started

Console Usage

pip(pip3) install -r requirements.txt

python .\main.py
Usage: main.py [options] arg1 arg2...

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -c GUICONFIG, --config=GUICONFIG
                        Load config generated by shadowsocksr-csharp.
  -u URL, --url=URL     Load ssr config from subscription url.
  -m TEST_METHOD, --method=TEST_METHOD
                        Select test method in [speedtestnet,fast,socket].
  -M TEST_MODE, --mode=TEST_MODE
                        Select test mode in [all,pingonly].
  --include             Filter nodes by group and remarks using keyword.
  --include-remark      Filter nodes by remarks using keyword.
  --include-group       Filter nodes by group name using keyword.
  --exclude             Exclude nodes by group and remarks using keyword.
  --exclude-group       Exclude nodes by group using keyword.
  --exclude-remark      Exclude nodes by remarks using keyword.
  -t PROXY_TYPE, --type=PROXY_TYPE
                        Select proxy type in [ssr,ss],default ssr.
  -y, --yes             Skip node list confirmation before test.
  -C RESULT_COLOR, --color=RESULT_COLOR
                    Set the colors when exporting images..
  -s SPLIT_COUNT, --split=SPLIT_COUNT
                        Set the number of nodes displayed in a single image
                        when exporting images.
  -S SORT_METHOD, --sort=SORT_METHOD
                        Select sort method in
                        [speed,rspeed,ping,rping],default not sorted.
  -i IMPORT_FILE, --import=IMPORT_FILE
                        Import test result from json file and export it.
  --debug               Run program in debug mode.

Example usage :

The parameter priority is as follows:

-i > -c > -u The above sequence indicates that if the parameter has a higher priority, the parameter will be used first, and other parameters will be ignored.

--include > --include-group > --include-remark --exclude > --exclude-group > --exclude-remark The above sequence indicates that node filtering will be performed in descending order of priority.

Web UI

python web.py
You can now access the WebUI through http://127.0.0.1:10870 

Modify the speed source of Socket mode

  • Just modify the link, size attribute in the object with the tag "Default" and the tag "Google", where "link" is the download source and "size" is the file corresponding to the download source. Size (MBytes)
  • For more advanced usage, please refer to the following [Advanced Usage]

Advanced Usage

  • Rules
    • The program has a built-in rule matching mode that allows specific ISPs or nodes in specific regions to use specific speed sources through custom rules for "Socket" test mode.Rules need to be written in config.py. Please see config.py for more details.
  • Custom color
    • Users can customize the color of the resulting image in config.py. See the config.py file for sample configuration.

Web Apis

The interfaces encapsulated in web.py are as follows:

Path Method Remark
/getversion GET Get backend version information
/status GET Get backend status
/readsubscriptions POST Get subscriptions
/getcolors GET Get the color configuration owned by the backend
/start POST Start the test, note that this is a block request, will return "done" after the test is completed, will not have any response
/getresults GET Get the current test result. If the "/start" is blocked, if you need to get the result in real time, you should poll the interface, but the time should not be less than 1s, preventing the backend from taking too much performance impact test.
  • /getversion The interface is requested without any parameters. The return example after the request is successful is as follows:
{
	"main" : "2.4.1",
	"webapi" : "0.4.1-beta"
}
  • /status The interface is requested without any parameters. The return example after the request is successful is as follows:
running => Running test.
stopped => Connected to the backend but no test is running
  • /readsubscriptions The parameters and examples required to request this interface are returned as follows:
POST => {
	"url" : "subscription url",
	"proxyType" : "Proxy Type"
}
Response (Success) => [
	{
	"Basic Config"
	}
]
Response (running) => "running" 
Response (Invalid URL) => "invalid url"
  • /getcolors The interface is requested without any parameters. The return example after the request is successful is as follows:
[
	{
	"Color Config"
	}
]
  • /getresults The interface is requested without any parameters. The return example after the request is successful is as follows:
{
	"status" : "running" or "pending" or "stopped",
	"current" : {},  //Node information currently being tested
	"results" : [] //The result array, please refer to the JSON file of the exported result for details.
}
  • /start The parameters required to request the interface and return are as follows, NOTE, this interface is a blocking interface
POST => {
	"testMethod" : "Test Method",
	"proxyType" : "Proxy Type",
	"testMode" : "Test Mode",
	"colors" : "Color Name", //Ignorable
	"sortMethod" : "Sort Method", //Ignorable
	"configs":[] //Standard configuration array
}
Response (Task Done) => "done"
Response (running) => "running" 
Response (No Configs) => "no configs"
  • Test Modes
Mode Remark
TCP_PING Only tcp ping, no speed test
ALL Full test
  • Test Methods
Methods Remark
SOCKET Socket download speed test
SPEED_TEST_NET Speed Test Net speed test
FAST Fast.com speed test
  • Proxy Types
Proxy Client Config Parser
SSR ShadowsocksR-libev (Windows)
ShadowsocksR-Python (Linux and MacOS)
ShadowsocksR
SSR-C# ShadowsocksR-C# (Windows)
ShadowsocksR-Python (Linux and MacOS)
ShadowsocksR
SS Shadowsocks-libev (All Platform) Shadowsocks | ShadowsocksD | Clash
V2RAY V2Ray-Core (All Platform) V2RayN | Quantumult | Clash

Developers

  • Removed as requested by the developer

Acknowledgement