Fix license compliance and fix things up, add reverse proxy, fix some security flaws with HttpUtils
Some checks failed
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm64:latest, aarch64-linux-gnu, arm64) (push) Successful in 2m37s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm:latest, arm-linux-gnueabihf, arm7) (push) Successful in 2m37s
Build and Deploy on Tag / 🔨 Build for PowerPC (push) Successful in 2m58s
Build and Deploy on Tag / 🔨 Build win32 and update the tap 🍺 (push) Failing after 3m36s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-riscv64:latest, riscv64-linux-gnu, riscv64) (push) Successful in 2m19s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x64:latest, x86_64-linux-gnu, amd64) (push) Successful in 2m21s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x86:latest, i386-linux-gnu, 386) (push) Successful in 2m6s
Some checks failed
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm64:latest, aarch64-linux-gnu, arm64) (push) Successful in 2m37s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm:latest, arm-linux-gnueabihf, arm7) (push) Successful in 2m37s
Build and Deploy on Tag / 🔨 Build for PowerPC (push) Successful in 2m58s
Build and Deploy on Tag / 🔨 Build win32 and update the tap 🍺 (push) Failing after 3m36s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-riscv64:latest, riscv64-linux-gnu, riscv64) (push) Successful in 2m19s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x64:latest, x86_64-linux-gnu, amd64) (push) Successful in 2m21s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x86:latest, i386-linux-gnu, 386) (push) Successful in 2m6s
This commit is contained in:
33
apps/tsimplereverseproxy.cpp
Normal file
33
apps/tsimplereverseproxy.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "TessesFramework/TessesFramework.hpp"
|
||||
#include <iostream>
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::Http;
|
||||
using namespace Tesses::Framework::Streams;
|
||||
using namespace Tesses::Framework::TextStreams;
|
||||
using namespace Tesses::Framework::Threading;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
TF_InitWithConsole();
|
||||
|
||||
uint16_t port = 4269;
|
||||
|
||||
Args args(argc, argv);
|
||||
for (auto &item : args.options) {
|
||||
if (item.first == "port")
|
||||
port = (uint16_t)std::stoul(item.second);
|
||||
}
|
||||
|
||||
if (args.positional.empty()) {
|
||||
Console::WriteLine(args.filename + " [--port=] <url_root>");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Tesses::Framework::Http::HttpServer server(
|
||||
port, std::make_shared<ReverseProxyServer>(args.positional[0]));
|
||||
server.StartAccepting();
|
||||
TF_RunEventLoop();
|
||||
std::cout << "Closing server" << std::endl;
|
||||
TF_Quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +1,14 @@
|
||||
#include <TessesFramework/TessesFramework.hpp>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::TextStreams;
|
||||
Tesses::Framework::TF_InitWithConsole();
|
||||
std::cout << Tesses::Framework::Date::GetTimeZone() << std::endl;
|
||||
StdOut() << "TimeZone Standard Offset: "
|
||||
<< (int64_t)(Date::GetTimeZone() / 3600) << NewLine();
|
||||
StdOut() << (Date::TimeZoneSupportDST() ? "TimeZone Supports DST"
|
||||
: "TimeZone Doesn't Support DST")
|
||||
<< NewLine();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user