Build

We’ll only cover the build process on Linux since we will be providing Windows and macOS binaries. Building trojan on every platform is similar.

Dependencies

Install these dependencies before you build (note that the test has some additional dependencies):

For Debian users, run sudo apt -y install build-essential cmake libboost-system-dev libboost-program-options-dev libssl-dev default-libmysqlclient-dev to install all the necessary dependencies.

Clone

Type in

git clone https://github.com/trojan-gfw/trojan.git
cd trojan/

to clone the project and go into the directory.

Build and Install

Type in

mkdir build
cd build/
cmake ..
make
ctest
sudo make install

to build, test, and install trojan. If everything goes well you’ll be able to use trojan.

The cmake .. command can be extended with the following options:

After installation, config examples will be installed to ${CMAKE_INSTALL_DOCDIR}/examples/ and a server config will be installed to ${CMAKE_INSTALL_FULL_SYSCONFDIR}/trojan/config.json.

Homepage Prev Page Next Page