1. 程式人生 > >龍芯平臺編譯ShadowSocks

龍芯平臺編譯ShadowSocks

打遊戲的人最怕什麼?延時。如果遊戲在電信的網路,而你恰恰是個聯通使用者,哈哈,那你慘了!如果你是個中移鐵通使用者,恭喜你,你更慘了。

那麼,有沒有辦法打通各網路間的通訊呢?有,尋找中間伺服器,比如阿里雲,不論是電信還是聯通,都很快。那麼,通過阿里雲作為媒介,可以極大的降低2個網路間的延遲。用到的工具呢,可以是ShadowSocks。

編譯libShadowSocks

https://github.com/shadowsocks/libQtShadowsocks/wiki/Compiling
環境

sudo dnf install qt5
版本Qt >= 5.5

sudo dnf install botan2
版本Botan-2 >= 2.3.0
Or Botan-1.10 (Not recommended)

sudo dnf install cmake
版本CMake >= 3.1

sudo dnf install gcc
A C++ Compiler that supports C++14 features (i.e. GCC >= 4.9)

Building
Building on GNU/Linux
Download and extract the latest source code tarball from release

不要在生產環境使用主分支的程式碼,因為還在開發階段。請使用stable穩定分支。

git clone -b stable https://github.com/shadowsocks/libQtShadowsocks.git

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
The above procedures will compile and install both libQtShadowsocks and shadowsocks-libQtShadowsocks. If you're a packager, you might need to split it into two or three packages depending on your distribution's guidelines.

Botan-1.10 vs Botan-2
libQtShadowsocks is compiled against Botan-1.10 by default, to use Botan-2, you need to pass an additional argument -DUSE_BOTAN2=ON to cmake command.

Building on Microsoft Windows w/ MSYS2 MinGW
Setup Environment
pacman -Syu mingw-w64-x86_64-qt5 mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake
botan-2 needs to be manually compiled:

./configure.py --prefix=/mingw64 --disable-modules=tls --os=mingw --without-stack-protector
make -j4
make install
libQtShadowsocks Installation
mkdir build && cd build
cmake -G "MSYS Makefiles" .. -DUSE_BOTAN2=ON -DCMAKE_INSTALL_PREFIX=/mingw64
make -j4
make install

編譯
cmake >= 3.1.0
qt5-qtbase-gui >= 5.2 (qtbase5 in Debian/Ubuntu)
qrencode (libqrencode in Debian/Ubuntu)
libQtShadowsocks >= 1.10.0 (libqtshadowsocks in Debian/Ubuntu. DON'T use the trunk code)
zbar (libzbar0 or libzbar in Debian/Ubuntu)
libappindicator (libappindicator1 in Debian/Ubuntu)
Check libQtShadowsocks Compiling wiki if you need to build it yourself.

Compiling
GNU/Linux
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo ma