From edc4a8b5006cc4dce9dd3d5ec5b0a6ff35d6e62d Mon Sep 17 00:00:00 2001 From: neru Date: Sun, 22 Mar 2026 07:41:48 -0300 Subject: [PATCH] feat: allow url modification --- src/unlocker/proxy.cpp | 7 +++++++ src/unlocker/proxy.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/unlocker/proxy.cpp b/src/unlocker/proxy.cpp index 372e7ae..3d1db8b 100644 --- a/src/unlocker/proxy.cpp +++ b/src/unlocker/proxy.cpp @@ -335,6 +335,10 @@ void Proxy::handleClient(SOCKET hClientSocket) { std::string emptyBody = ""; OnClientRequest.run(url, emptyBody, headers); + + if (!pendingUrls.empty()) + pendingUrls.back() = url; + SSL_write(remoteSSL, headers.data(), (int)headers.size()); clientStream.buffer.erase(0, clientStream.headersEnd + 4); clientStream.reset(); @@ -383,6 +387,9 @@ void Proxy::handleClient(SOCKET hClientSocket) if (complete) { OnClientRequest.run(url, body, headers); + if (!pendingUrls.empty() && pendingUrls.back() != url) + pendingUrls.back() = url; + SSL_write(remoteSSL, headers.data(), (int)headers.size()); SSL_write(remoteSSL, clientStream.buffer.data() + bodyStart, (int)(clientStream.buffer.size() - bodyStart)); diff --git a/src/unlocker/proxy.h b/src/unlocker/proxy.h index e6bba4f..7e0441b 100644 --- a/src/unlocker/proxy.h +++ b/src/unlocker/proxy.h @@ -25,7 +25,7 @@ class Proxy bool Init(); void Shutdown(); - CallbackEvent OnClientRequest; + CallbackEvent OnClientRequest; CallbackEvent OnServerResponse; private: