HTTP-2-lib
Public Member Functions | Static Public Member Functions
h2_server Class Reference

#include <h2_server.hpp>

Public Member Functions

 h2_server (const char *certKeyFile, const char *certFile)
 
void run (const char *port)
 

Static Public Member Functions

static void setPublicDir (string dir)
 
static void addRoute (string path, string filepath)
 
static void enableCommentsPrint (bool enable)
 
static void enableTrackersPrint (bool enable)
 
static void enableFramesPrint (bool enable)
 

Constructor & Destructor Documentation

◆ h2_server()

h2_server::h2_server ( const char *  certKeyFile,
const char *  certFile 
)

Initiates a h2_server object

Parameters
certKeyFile- path to .pem key file
certFile- path to .pem certificate file

Member Function Documentation

◆ addRoute()

void h2_server::addRoute ( string  path,
string  filepath 
)
static

Add a route for a file to be served on

Parameters
appCtx- ApplicationContext for whole server
path- route to serve
filepath- path of the file to serve, in publicDir

◆ enableCommentsPrint()

void h2_server::enableCommentsPrint ( bool  enable)
static

Turn on/off comment prints

Parameters
enable- bool true enables, false disables

◆ enableFramesPrint()

void h2_server::enableFramesPrint ( bool  enable)
static

Turn on/off frames prints

Parameters
enable- bool true enables, false disables

◆ enableTrackersPrint()

void h2_server::enableTrackersPrint ( bool  enable)
static

Turn on/off trackers prints

Parameters
enable- bool true enables, false disables

◆ run()

void h2_server::run ( const char *  port)

Runs the server on provided port

Parameters
port- port to run server on

◆ setPublicDir()

void h2_server::setPublicDir ( string  dir)
static

Set the path to be used as public directory on the server

Parameters
dir- string with the path

The documentation for this class was generated from the following files: