diff options
Diffstat (limited to 'src/curl_wrapper.cpp')
-rw-r--r-- | src/curl_wrapper.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/curl_wrapper.cpp b/src/curl_wrapper.cpp index 7b0eb79..0b8b49c 100644 --- a/src/curl_wrapper.cpp +++ b/src/curl_wrapper.cpp @@ -63,6 +63,16 @@ CURLWrapper::~CURLWrapper() noexcept } } +void CURLWrapper::set_proxy(const string_view proxy) +{ + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) + CURLcode code = curl_easy_setopt(_connection, CURLOPT_PROXY, proxy); + if (code != CURLE_OK) + { + throw CURLException{code, "Failed to set proxy", _curl_buffer_error}; + } +} + answer_type CURLWrapper::make_request(const http_method &method, string uri, const parametermap ¶meters) { |