add command-line options

This commit is contained in:
Tixx
2024-09-22 22:02:36 +02:00
parent 768f11f6ec
commit aca61886d0
11 changed files with 123 additions and 52 deletions

View File

@@ -26,6 +26,7 @@
#include <mutex>
#include <string>
#include <thread>
#include "Options.h"
std::chrono::time_point<std::chrono::high_resolution_clock> PingStart, PingEnd;
bool GConnected = false;
@@ -161,7 +162,7 @@ SOCKET SetupListener() {
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = AI_PASSIVE;
iRes = getaddrinfo(nullptr, std::to_string(DEFAULT_PORT + 1).c_str(), &hints, &result);
iRes = getaddrinfo(nullptr, std::to_string(options.port + 1).c_str(), &hints, &result);
if (iRes != 0) {
error("(Proxy) info failed with error: " + std::to_string(iRes));
WSACleanup();