-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (29 loc) · 1.03 KB
/
main.cpp
File metadata and controls
32 lines (29 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// main.cpp
// HTTPS Server
//
// Created by Frederick Benjamin Woodruff on 07/12/2021.
//
#include "server.hpp"
#include "global.hpp"
#include "Runtime/executor.hpp"
#include "TCP/listener.hpp"
#include "TLS/session_ticket.hpp"
#include "TLS/Cryptography/one_way/keccak.hpp"
#include <print>
int main(int argc, const char* argv[]) {
try {
auto config_path = fbw::get_config_path(argc, argv);
fbw::init_options(config_path);
auto http_port = fbw::project_options.redirect_port;
auto http_listener = fbw::tcplistener::bind(http_port);
auto https_port = fbw::project_options.server_port;
auto https_listener = fbw::tcplistener::bind(https_port);
fbw::randomgen.randgen(fbw::session_ticket_master_secret);
fbw::randomgen.randgen(fbw::session_ticket_master_secret);
run(async_main(std::move(https_listener), https_port, std::move(http_listener), http_port));
} catch(const std::exception& e) {
std::println(stderr, "main: {}\n", e.what());
}
return 0;
}