added proxying

This commit is contained in:
frosty
2026-02-27 18:32:23 -05:00
parent 26e3403e03
commit 9f2cd56128
13 changed files with 416 additions and 17 deletions

View File

@@ -1,4 +1,6 @@
#include "Dictionary.h"
#include "../Proxy/Proxy.h"
#include "../Scraping/Scraping.h"
#include <curl/curl.h>
#include <libxml/HTMLparser.h>
#include <libxml/xpath.h>
@@ -216,6 +218,7 @@ InfoBox fetch_dictionary_data(const char *query) {
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &chunk);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
apply_proxy_settings(curl);
if (curl_easy_perform(curl) == CURLE_OK && chunk.size > 0) {
htmlDocPtr doc = htmlReadMemory(chunk.memory, chunk.size, url, NULL,

View File

@@ -1,4 +1,6 @@
#include "Wikipedia.h"
#include "../Proxy/Proxy.h"
#include "../Scraping/Scraping.h"
#include <curl/curl.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
@@ -123,6 +125,7 @@ InfoBox fetch_wiki_data(char *api_url) {
WikiWriteMemoryCallback);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk);
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0");
apply_proxy_settings(curl_handle);
res = curl_easy_perform(curl_handle);