Hermes
0.7.0
Linux game streaming host
Toggle main menu visibility
Loading...
Searching...
No Matches
confighttp.h
Go to the documentation of this file.
1
5
#pragma once
6
7
// standard includes
8
#include <functional>
9
#include <chrono>
10
#include <string>
11
#include <unordered_map>
12
#include <string_view>
13
14
// lib includes
15
#include <nlohmann/json.hpp>
16
17
// local includes
18
#include "
thread_safe.h
"
19
20
#define WEB_DIR HERMES_ASSETS_DIR "/web/"
21
22
using namespace
std::chrono_literals;
23
24
namespace
confighttp {
25
constexpr
auto
PORT_HTTPS = 1;
26
constexpr
auto
SESSION_EXPIRE_DURATION = 24h * 15;
27
void
start
();
28
35
nlohmann::json
hestia_preflight_json
();
36
45
nlohmann::json
hestia_capabilities_json
();
46
54
nlohmann::json
computed_config_json
();
55
66
nlohmann::json &
overlay_config_file
(nlohmann::json &response,
const
std::unordered_map<std::string, std::string> &file_values);
67
73
bool
local_api_token_origin_allowed
(std::string_view address);
74
}
// namespace confighttp
75
76
// mime types map
77
const
std::map<std::string, std::string> mime_types = {
78
{
"css"
,
"text/css"
},
79
{
"gif"
,
"image/gif"
},
80
{
"htm"
,
"text/html"
},
81
{
"html"
,
"text/html"
},
82
{
"ico"
,
"image/x-icon"
},
83
{
"jpeg"
,
"image/jpeg"
},
84
{
"jpg"
,
"image/jpeg"
},
85
{
"js"
,
"application/javascript"
},
86
{
"json"
,
"application/json"
},
87
{
"png"
,
"image/png"
},
88
{
"svg"
,
"image/svg+xml"
},
89
{
"ttf"
,
"font/ttf"
},
90
{
"txt"
,
"text/plain"
},
91
{
"woff2"
,
"font/woff2"
},
92
{
"xml"
,
"text/xml"
},
93
};
confighttp::local_api_token_origin_allowed
bool local_api_token_origin_allowed(std::string_view address)
Whether an address may authenticate with the Game Mode local token.
Definition
confighttp.cpp:78
confighttp::hestia_capabilities_json
nlohmann::json hestia_capabilities_json()
The Hestia extension capabilities document.
Definition
confighttp.cpp:1684
confighttp::computed_config_json
nlohmann::json computed_config_json()
Get the configuration settings.
Definition
confighttp.cpp:1619
confighttp::overlay_config_file
nlohmann::json & overlay_config_file(nlohmann::json &response, const std::unordered_map< std::string, std::string > &file_values)
Overlay a parsed hermes.conf onto response, in place.
Definition
confighttp.cpp:1637
confighttp::start
void start()
Start the HTTPS server.
Definition
confighttp.cpp:4137
confighttp::hestia_preflight_json
nlohmann::json hestia_preflight_json()
Aggregate "is the host ready to stream?" checks.
Definition
confighttp.cpp:2283
thread_safe.h
Declarations for thread-safe data structures.
src
confighttp.h
Generated by
1.18.0