Skip to content
/ net Public

A small network library written for use in C++ applications. Written in C++17.

License

Notifications You must be signed in to change notification settings

jontitorr/net

Repository files navigation

Net

A small network library written for use in C++ applications.

Features

  • SslStream: An OpenSSL wrapper for TCP/UDP sockets.
  • HttpConnection/HttpServer: HTTP(s) client/server.
  • WebSocketClient: WebSocket client.

Getting Started

Prerequisites

  • CMake (version >= 3.15)
  • Compiler with C++17 support, i.e. MSVC, GCC, Clang

Installing

This library uses CPM.cmake to manage dependencies. It is an amazing package manager for CMake projects and allows us to install the entire library using the following commands:

  git clone https://www.github.com/xminent/net
  cd net
  cmake -S . -B build
  cmake --build build --target install

From there you can simply integrate it into your CMake project like so:

    find_package(net REQUIRED)
    target_link_libraries(${PROJECT_NAME} PRIVATE net::net)

Usage/Examples

See examples.

Dependencies

Third party Dependencies

  • expected (comes bundled with project)
  • OpenSSL (comes bundled with project, unless you have it installed)
  • span (comes bundled with project)

License

MIT