This commit is contained in:
2026-02-16 12:26:36 -06:00
commit 38b72793ad
13 changed files with 626 additions and 0 deletions

30
compile.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
mkdir -p bin
# add libssl-dev if needed
# apt-get update && apt-get install -y --no-install-recommends libssl-dev
# Adjust flags as you like
CXXFLAGS="-std=c++17 -O2 -Wall -Wextra -pedantic"
OPENSSL_LIBS="-lssl -lcrypto"
g++ ${CXXFLAGS} server.cpp -o bin/server ${OPENSSL_LIBS}
g++ ${CXXFLAGS} client.cpp -o bin/client ${OPENSSL_LIBS}
echo "Built:"
file bin/server bin/client || true
chmod a+x bin/server bin/client
# stop the containers and free up network resources
docker compose down --remove-orphans || true
docker network rm net-hw2 >/dev/null 2>&1 || true
# start the containers
docker compose up -d server
docker compose run --rm -it client
echo "Done."