Skip to content

Commit

Permalink
v0.2.0-alpha
Browse files Browse the repository at this point in the history
First public version
  • Loading branch information
tindy2013 committed Aug 1, 2019
1 parent b9878ac commit 2f5b0f7
Show file tree
Hide file tree
Showing 51 changed files with 5,160 additions and 1 deletion.
71 changes: 70 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,70 @@
# stairspeedtest-reborn
# Stair Speedtest Reborn
**Proxy performance batch tester based on Shadowsocks(R) and V2Ray**
<img alt="GitHub tag (latest SemVer)" src="https://img.shields.io/github/tag/tindy2013/stairspeedtest-reborn.svg">
<img alt="GitHub release" src="https://img.shields.io/github/release/tindy2013/stairspeedtest-reborn.svg">
<img src="https://img.shields.io/github/license/tindy2013/stairspeedtest-reborn.svg">

## Intro
This is a C++ remake version of the original [Stair Speedtest](https://github.com/tindy2013/stairspeedtest) script. Despite its similarity to the script verion, this remake version works much more effectively, with faster node parsing, result picture rendering and even cross-platform support.

## Installation
### Prebuilt release
Go to [Release Page](https://github.com/tindy2013/stairspeedtest-reborn).
### Build
In general, you need the following build dependencies:
* curl
* openssl
* PNGwriter
* libpng16
* freetype
* zlib
* yaml-cpp

On non-Windows platforms, you also need to have the following clients installed:
* shadowsocks-libev
* shadowsocksr-libev ('ss-local' installed as the name 'ssr-local')
* v2ray-core

You can also use the auto configure script (experimental):
```bash
# On most Linux platforms
./config.sh

# On MacOS:
./config.macos.sh
```

After installing all these dependencies, you can use the quick build script:
```bash
# On Windows
build.bat

# On most Linux platforms
./build.sh

# On MacOS:
./build.macos.sh
```
## Usage
* Run "stairspeedtest" for CLI speedtest, run "webgui" for Web GUI speedtest. **Currently Web GUI only supports on Windows.**
* Results for subscribe link tests will be saved to a log file in "results" folder.
* The result will be exported into a PNG file with the result log. An interactive HTML file with test results will also be generated with the PNG file. In this HTML, you can sort by name, ping, packet loss or speed.
* You can customize some settings by editing "pref.ini".
## Compatibility
Tested platforms:

* Windows 10 1803 x64, Windows Server 2008 R2
* Ubuntu 18.10
* MacOS 10.14.3 Mojave

Supported proxy types:

|Proxy|Client|Config Parser|
|:-:|:-:|:-:|
|SSR|ShadowsocksR-libev|ShadowsocksR|
|SS|Shadowsocks-libev|Shadowsocks \| ShadowsocksD \| Clash \| Surge (experimental) |
|V2RAY|V2Ray-Core|V2RayN \| Quantumult \| Clash
## Known Bugs
You tell me?
## TODO
* Web GUI support on all platform
13 changes: 13 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c logger.cpp -o obj\logger.o
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c main.cpp -o obj\main.o
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c misc.cpp -o obj\misc.o
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c multithread-test.cpp -o obj\multithread-test.o
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c printout.cpp -o obj\printout.o
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c processes.cpp -o obj\processes.o
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c renderer.cpp -o obj\renderer.o
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c socket.cpp -o obj\socket.o
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c speedtestutil.cpp -o obj\speedtestutil.o
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c tcping.cpp -o obj\tcping.o
gcc -Wall -fexceptions -D_WIN32 -DCURL_STATICLIB -DUNICODE -g -std=c++11 -c webget.cpp -o obj\webget.o
windres -J rc -O coff -i res\res.rc -o obj\res\res.res
g++ -o stairspeedtest.exe obj\logger.o obj\main.o obj\misc.o obj\multithread-test.o obj\printout.o obj\processes.o obj\renderer.o obj\socket.o obj\speedtestutil.o obj\tcping.o obj\webget.o obj\res\res.res -lpsapi -lyaml-cpp -lcurl -lPNGwriter -lpng16 -lfreetype -lz -lssl -lcrypto -lws2_32 -lwsock32
18 changes: 18 additions & 0 deletions build.macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -e
mkdir obj
mkdir bin
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c logger.cpp -o obj/logger.o
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c main.cpp -o obj/main.o
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c misc.cpp -o obj/misc.o
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c multithread-test.cpp -o obj/multithread-test.o
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c printout.cpp -o obj/printout.o
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c processes.cpp -o obj/processes.o
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c renderer.cpp -o obj/renderer.o
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c socket.cpp -o obj/socket.o
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c speedtestutil.cpp -o obj/speedtestutil.o
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c tcping.cpp -o obj/tcping.o
gcc -I/usr/local/include -Wall -fexceptions -D_MACOS -DCURL_STATICLIB -g -std=c++11 -c webget.cpp -o obj/webget.o
g++ -g -o stairspeedtest obj/logger.o obj/main.o obj/misc.o obj/multithread-test.o obj/printout.o obj/processes.o obj/renderer.o obj/socket.o obj/speedtestutil.o obj/tcping.o obj/webget.o -L/usr/local/lib -lcurl -lPNGwriter -lpng16 -lfreetype -lz -lssl -lcrypto -lyaml-cpp -ldl -lpthread
chmod +x stairspeedtest

18 changes: 18 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -e
mkdir obj
mkdir bin
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c logger.cpp -o obj/logger.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c main.cpp -o obj/main.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c misc.cpp -o obj/misc.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c multithread-test.cpp -o obj/multithread-test.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c printout.cpp -o obj/printout.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c processes.cpp -o obj/processes.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c renderer.cpp -o obj/renderer.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c socket.cpp -o obj/socket.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c speedtestutil.cpp -o obj/speedtestutil.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c tcping.cpp -o obj/tcping.o
gcc -Wall -fexceptions -DCURL_STATICLIB -g -std=c++11 -c webget.cpp -o obj/webget.o
g++ -g -o stairspeedtest obj/logger.o obj/main.o obj/misc.o obj/multithread-test.o obj/printout.o obj/processes.o obj/renderer.o obj/socket.o obj/speedtestutil.o obj/tcping.o obj/webget.o -lcurl -lPNGwriter -lpng16 -lfreetype -lz -lssl -lcrypto -ldl -lpthread -lyaml-cpp
chmod +x stairspeedtest

129 changes: 129 additions & 0 deletions config.macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#!/bin/bash
set -e
#initialize sudo so that no password entering during installation
sudo -v

echo installing brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

echo preconfigure compiler
brew install gcc

#don't remove these for non-xcode user
#cd /usr/bin
#sudo rm -f g++ gcc c++ cpp cc
#sudo ln -s /usr/local/Cellar/gcc/9.1.0/bin/c++-9 /usr/bin/c++
#sudo ln -s /usr/local/Cellar/gcc/9.1.0/bin/cpp-9 /usr/bin/cpp
#sudo ln -s /usr/local/Cellar/gcc/9.1.0/bin/g++-9 /usr/bin/g++
#sudo ln -s /usr/local/Cellar/gcc/9.1.0/bin/gcc-9 /usr/bin/gcc
#sudo ln -s /usr/local/Cellar/gcc/9.1.0/bin/gcc-9 /usr/bin/cc
#fix for cmake which uses a different path
#sudo rm -f g++ gcc c++ cpp cc
#sudo ln -s /usr/local/Cellar/gcc/9.1.0/bin/c++-9 /Library/Developer/CommandLineTools/usr/bin/c++
#sudo ln -s /usr/local/Cellar/gcc/9.1.0/bin/cpp-9 /Library/Developer/CommandLineTools/usr/bin/cpp
#sudo ln -s /usr/local/Cellar/gcc/9.1.0/bin/g++-9 /Library/Developer/CommandLineTools/usr/bin/g++
#sudo ln -s /usr/local/Cellar/gcc/9.1.0/bin/gcc-9 /Library/Developer/CommandLineTools/usr/bin/gcc
#sudo ln -s /usr/local/Cellar/gcc/9.1.0/bin/gcc-9 /Library/Developer/CommandLineTools/usr/bin/cc

echo installing tools with brew
brew install wget cmake zlib

echo downloading and compiling openssl-1.1.1c
wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz
tar xvf openssl-1.1.1c.tar.gz
cd openssl-1.1.1c
#override compiler
CC=gcc ./config --prefix=/usr/local
make -j8
#don't install docs since we don't need them
sudo make install_sw -j8
#fix install error
sudo install libssl.a /usr/local/lib/
sudo install libssl.dylib /usr/local/lib/
sudo install libcrypto.a /usr/local/lib/
sudo install libcrypto.dylib /usr/local/lib/
cd ..

#using system-default libcurl
#echo downloading and compiling curl-7.65.1
#wget https://curl.haxx.se/download/curl-7.65.1.tar.gz
#tar xvf curl-7.65.1.tar.gz
#cd curl-7.65.1
#./configure --disable-shared --disable-ldap --disable-ldaps --disable-smtp --disable-pop3 --disable-rtmp --disable-imap --disable-gopher --disable-telnet --disable-tftp
#make -j8
#sudo make install -j8
#cd ..

echo downloading and compiling libpng-1.6.37
wget https://nchc.dl.sourceforge.net/project/libpng/libpng16/1.6.37/libpng-1.6.37.tar.gz
tar xvf libpng-1.6.37.tar.gz
cd libpng-1.6.37
./configure
make -j8
sudo make install -j8
cd ..

echo downloading and compiling freetype-2.10.1
wget https://nchc.dl.sourceforge.net/project/freetype/freetype2/2.10.1/freetype-2.10.1.tar.xz
tar xvf freetype-2.10.1.tar.xz
cd freetype-2.10.1
./configure
make -j8
sudo make install -j8
#a fix for incorrect file path
sudo mv /usr/local/include/freetype2/* /usr/local/include
sudo rmdir /usr/local/include/freetype2
cd ..

echo downloading and compiling pngwriter
git clone https://github.com/pngwriter/pngwriter
cd pngwriter
cmake .
make -j8
sudo make install -j8
#fix install error
#sudo install libPNGwriter.a /usr/local/lib/
cd ..

echo downloading and installing rapidjson
git clone https://github.com/tencent/rapidjson
cd rapidjson
cmake .
make -j8
sudo make install -j8
cd ..

#install ss-local from brew
echo installing shadowsocks-libev from brew
brew install shadowsocks-libev

#extra tools for ssr-local
#but ss-libev has already covered these

#brew install asciidoc xmlto pcre

#use brew version is okay
#echo downloading and compiling pcre-8.43
#wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
#tar xvf pcre-8.43.tar.gz
#cd pcre-8.43
#./configure
#make -j8
#sudo make install -j8
#cd ..

echo downloading and compiling shadowsocksr-libev
git clone https://github.com/shadowsocksrr/shadowsocksr-libev
cd shadowsocksr-libev
#override some warning settings
CFLAGS+="-Wno-format-overflow -Wno-format-truncation -Wno-sizeof-pointer-memaccess" ./configure --with-openssl-lib=/usr/local/lib --with-openssl-include=/usr/local/include --disable-documentation
make -j8
#will not directly install this one, use another method
sudo install src/ss-local /usr/local/bin/ssr-local
cd ..

echo installing v2ray from brew
brew tap v2ray/v2ray
brew install v2ray-core

echo all done!
80 changes: 80 additions & 0 deletions config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/bash
set -e
echo prep up basic env
apt update -y
apt upgrade -y

echo installing toolchain
apt install g++ libssl-dev git wget curl make cmake -y

echo downloading and compiling curl-7.65.1
wget https://curl.haxx.se/download/curl-7.65.1.tar.gz
tar xvf curl-7.65.1.tar.gz
cd curl-7.65.1
./configure --with-ssl --disable-shared
make -j8
make install -j8
cd ..

echo downloading and compiling zlib-1.2.11
wget http://www.zlib.net/zlib-1.2.11.tar.gz
tar xvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make -j8
make install -j8
cd ..

echo downloading and compiling libpng-1.6.37
wget https://nchc.dl.sourceforge.net/project/libpng/libpng16/1.6.37/libpng-1.6.37.tar.gz
tar xvf libpng-1.6.37.tar.gz
cd libpng-1.6.37
./configure
make -j8
make install -j8
cd ..

echo downloading and compiling freetype-2.10.1
wget https://nchc.dl.sourceforge.net/project/freetype/freetype2/2.10.1/freetype-2.10.1.tar.xz
tar xvf freetype-2.10.1.tar.xz
cd freetype-2.10.1
./configure
make -j8
make install -j8
cd ..

echo downloading and compiling pngwriter
git clone https://github.com/pngwriter/pngwriter
cd pngwriter
cmake .
make -j8
make install -j8
cd ..

echo downloading and installing rapidjson
git clone https://github.com/tencent/rapidjson
cd rapidjson
cmake .
make -j8
make install -j8

echo installing shadowsocks-libev
apt install shadowsocks-libev -y

echo downloading and compiling shadowsocksr-libev
git clone https://github.com/shadowsocksrr/shadowsocksr-libev
cd shadowsocksr-libev
#override some warning settings
CFLAGS+="-Wno-format-overflow -Wno-format-truncation -Wno-sizeof-pointer-memaccess" ./configure --with-openssl-lib=/usr/local/lib --with-openssl-include=/usr/local/include --disable-documentation
make -j8
#will not directly install this one, use another method
sudo install src/ss-local /usr/local/bin/ssr-local
cd ..

echo installing v2ray
bash <(curl -Ls https://install.direct/go.sh)
#make some link
sudo ln -s /usr/bin/v2ray/v2ray /usr/local/bin/v2ray
sudo ln -s /usr/bin/v2ray/v2ctl /usr/local/bin/v2ctl

echo all done!
Loading

0 comments on commit 2f5b0f7

Please sign in to comment.