XMPP Server written in C++ built specifically around the XTRPG specifications.
This project uses CMake (v3.20+) and vcpkg in Manifest Mode (vcpkg.json) to manage dependencies (such as Asio and OpenSSL) across Windows, Linux, and macOS.
Before building the project, ensure you have the following installed:
- C++ Compiler: Supporting C++20 standard
- Windows: Visual Studio 2022 (with Desktop development with C++)
- Linux: GCC 11+ or Clang 13+
- macOS: Xcode Command Line Tools (Clang)
- CMake: Version 3.20 or higher
- Git
vcpkg is used to fetch and compile third-party libraries automatically during the CMake configuration step.
# 1. Clone vcpkg to a persistent directory
git clone https://github.com/microsoft/vcpkg.git C:\microsoft\vcpkg
# 2. Run the bootstrap script to create vcpkg.exe
cd C:\microsoft\vcpkg
.\bootstrap-vcpkg.bat
# 3. Set the environment variable for your current session / system
$env:VCPKG_ROOT="C:\microsoft\vcpkg"
[System.Environment]::SetEnvironmentVariable("VCPKG_ROOT", "C:\microsoft\vcpkg", [System.EnvironmentVariableTarget]::User)# 1. Clone vcpkg
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
# 2. Run the bootstrap script
cd ~/vcpkg
./bootstrap-vcpkg.sh
# 3. Export VCPKG_ROOT in your shell profile (~/.bashrc or ~/.zshrc)
export VCPKG_ROOT="$HOME/vcpkg"# WINDOWS
openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -days 365 -nodes -subj "/CN=localhost"
# LINUX/MACOS
openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -days 365 -nodes -subj "//CN=localhost"Since the project uses vcpkg.json, dependencies will automatically download and build during the initial CMake setup.
Pass the vcpkg toolchain file during configuration:
-
Linux / macOS:
cmake -B build -S . \ -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \ -DCMAKE_BUILD_TYPE=Release
-
Windows (PowerShell):
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build build --config ReleaseOnce complete, the executable entry point will be output in:
- Single-config generators (Linux/macOS):
./build/xtrpg_cpp_server - Multi-config generators (Windows/Visual Studio):
.\build\Release\xtrpg_cpp_server.exe
For multi-config generators on Linux/macOS, use ./build/<Config>/xtrpg_cpp_server instead.
# Build the Docker image locally
docker build -t xmpp-builder .
# Extract the compiled binary out of Docker onto the host OS
docker run --rm -v $(pwd)/dist:/output xmpp-builder cp /app/xtrpg_cpp_server /output/- RFC6120 Extensible Messaging and Presence Protocol (XMPP): Core
- RFC6121 Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence
- XEP-0134 XMPP Design Guidelines
- XEP-0030 Service Discovery
- XEP-0115 Entity Capabilities
- XEP-0198 Stream Management
- XEP-0280 Message Carbons
- XEP-0313 Message Archive Management (MAM)
- XEP-0363 HTTP File Upload
- XEP-0045 Multi-User Chat (MUC)
- XEP-0060 Publish-Subscribe (PubSub)
- XEP-0163 Personal Event Protocol (PEP)