Skip to content

A versatile C++ server implementation leveraging Boost.Asio for robust networking capabilities. It is designed to handle various server-side functionalities including authentication, file management, encryption-decryption, client-server communication, database interactions, and WebSocket streaming.

Notifications You must be signed in to change notification settings

ravi-ivar-7/CPP-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Server with Boost.Asio

A high-performance, low-level server using C++ and Boost.Asio library and is designed to handle a wide range of functionalities, including authentication, file handling, requests, encryption-decryption, client-side rendering, databases, and WebSocket communication for streaming text.

Features

  • Authentication: Secure user authentication.
  • File Handling: Efficient file upload and download capabilities.
  • Request Handling: Robust request/response mechanism for client-server communication with get/post fetch capabilities.
  • Encryption/Decryption: Secure data transmission using modern encryption techniques(RSA-256 encryption/decryption).
  • Client-Side Rendering: Dynamic content rendering on the client side.
  • Database Integration: Seamless interaction with databases for data storage and retrieval.
  • WebSocket Support: Real-time text streaming using WebSocket technology.

Project Structure

CPP-Server/
├── CMakeLists.txt
├── makefile
├── .gitignore
├── readme.md
|
|── assets/
│   ├── downloads
|   ├── logs/log.csv
|   ├── js
│   └── css
|
├── config/
│   ├── .env
|   ├── publicKey.pem
│   └── privateKey.pem
|
├── docs/
│   ├── 
│   └── 
|
├── src/
|   ├── auth
|   |       ├── authenticate.cpp
|   |       ├── authenticate.hpp
│   |       └── readme.md
|   ├── client
|   |       ├── render_html.cpp
|   |       ├── render_html.hpp
│   |       └── readme.md
|   ├── files
|   |       ├── download.cpp
|   |       ├── download.hpp
|   |       ├── upload.cpp
|   |       ├── upload.hpp
|   |       ├── utils.cpp
|   |       ├── utils.hpp
│   |       └── readme.md
|   ├── requests
|   |       ├── HttpServic.cpp
|   |       ├── utils.cpp
|   |       ├── utils.hpp
│   |       └── readme.md
|   ├── security
|   |       ├── encryption_decrypton.cpp
|   |       ├── encryption_decrypton.hpp
|   |       ├── utils.cpp
|   |       ├── utils.hpp
│   |       └── readme.md
|   ├── servers
|   |       ├── http_server.cpp
|   |       ├── http_server.hpp
│   |       └── readme.md
|   ├── streaming
|   |       ├── text.cpp
|   |       ├── text.cpp
│   |       └── readme.md
|   ├── system
|   |       ├── log.cpp
|   |       ├── log.hpp
|   |       ├── sys_server_info.cpp
|   |       ├── sys_server_info.hpp
|   |       ├── utils.cpp
|   |       ├── utils.hpp
│   |       └── readme.md
|
├── templates/
│   |
│   ├── home.html
│   └── client.html
|
├── tests/
│   |
│   ├──comparision
|   |       ├── node-server
|   |       ├── fastapi-server
|   |
│   ├──────k6
|   |       ├── k6_http.js
|   |       ├── k6_ws.js
|   |
│   ├────locust
|   |       ├── locustfile.py
|   |
|   |────rest.http

To compile, build, and run the server in WSL:

Using makefile

Go to root directory
Run the make command to compile the server
Run server with compilled file $ ./server

Using CMake

Create a build directory
Run cmake to generate the build files
Run make to build the server
Run the server executable from the build directory
mkdir build
cd build
cmake ..
make
./server

Installation

Boost

Download and install it from https://www.boost.org.
OR
sudo apt-get update
sudo apt-get install -y libboost-all-dev

Nlohmann/json

sudo apt-get install -y nlohmann-json3-dev

OpenSSL

# On Debian/Ubuntu
sudo apt-get install libssl-dev

# On CentOS/RHEL
sudo yum install openssl-devel

Acknowledgments

About

A versatile C++ server implementation leveraging Boost.Asio for robust networking capabilities. It is designed to handle various server-side functionalities including authentication, file management, encryption-decryption, client-server communication, database interactions, and WebSocket streaming.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published