From 16b16c0654de8ff61c384d3d3dea4d8656135695 Mon Sep 17 00:00:00 2001 From: Duc-python Date: Sun, 11 Oct 2026 14:00:04 +0700 Subject: [PATCH 1/2] Add per-block proxy bypass and proxy variables to Http Request block Http Request blocks now expose a `useProxy` parameter (default `true`). When disabled, that single request is sent directly even if the job has proxies enabled, which was previously only possible by toggling the proxy at job level and restarting it. The check lives in a new `HttpRequestHandler.ResolveProxy` helper so all three HTTP libraries (RuriLibHttp, SystemNet, CurlImpersonate) honour it through a single choke point. When a block bypasses its proxy, a `[NO PROXY]` line is logged so the reason is visible in the bot log. ScriptGlobals now also exposes the bot proxy as `input.proxy.*` (ip, host, port, username, password, type, country, ping, inUse) so configs can read proxy fields without falling back to `data.Proxy`. Every field is always present, defaulting to empty, so configs do not need null checks. `inUse` reflects whether requests actually go through the proxy, which distinguishes "the bot has a proxy" from "this block is using it". Both additions are backwards compatible: `useProxy` defaults to the previous behaviour and is omitted from LoliCode when unchanged, and a wordlist slice literally named `proxy` keeps precedence over the new object. Also assigns `decodeHtmlSetting` in the native HttpRequestBlockSettingsViewer, which was declared in XAML but never bound, leaving the setting inert there. --- .../HttpRequestBlockSettingsViewer.xaml | 1 + .../HttpRequestBlockSettingsViewer.xaml.cs | 2 + OpenBullet2.Native/Utils/Suggestions.cs | 3 + .../Custom/HttpRequestBlockInstanceTests.cs | 37 +++++++ .../Models/Bots/ScriptGlobalsTests.cs | 98 ++++++++++++++++++- .../Http/HttpClientRequestHandler.cs | 8 +- RuriLib/Functions/Http/HttpRequestHandler.cs | 21 ++++ .../Http/Options/HttpRequestOptions.cs | 6 ++ .../Http/RLHttpClientRequestHandler.cs | 8 +- .../Custom/HttpRequestBlockDescriptor.cs | 4 + .../Blocks/Custom/HttpRequestBlockInstance.cs | 3 +- RuriLib/Models/Bots/ScriptGlobals.cs | 37 +++++++ .../config-stacker.component.ts | 3 + .../http-request-block.component.html | 11 +++ 14 files changed, 231 insertions(+), 11 deletions(-) diff --git a/OpenBullet2.Native/Controls/HttpRequestBlockSettingsViewer.xaml b/OpenBullet2.Native/Controls/HttpRequestBlockSettingsViewer.xaml index fd025edd2..6839d53b7 100644 --- a/OpenBullet2.Native/Controls/HttpRequestBlockSettingsViewer.xaml +++ b/OpenBullet2.Native/Controls/HttpRequestBlockSettingsViewer.xaml @@ -191,6 +191,7 @@ +