summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authortastytea2020-01-08 17:16:15 +0100
committertastytea2020-01-08 17:20:36 +0100
commitdeed340f3d98150f96ef78e7bb4e0ae9f35d4436 (patch)
tree9b72ff9c8d76655b6911d75896ccef3f5520ea1a /include
parent1f78b00205f885c6becdbb51688393cd37573899 (diff)
downloadmastodonpp-deed340f3d98150f96ef78e7bb4e0ae9f35d4436.tar
mastodonpp-deed340f3d98150f96ef78e7bb4e0ae9f35d4436.tar.gz
mastodonpp-deed340f3d98150f96ef78e7bb4e0ae9f35d4436.zip
Add set_proxy().
Diffstat (limited to 'include')
-rw-r--r--include/connection.hpp7
-rw-r--r--include/curl_wrapper.hpp12
2 files changed, 19 insertions, 0 deletions
diff --git a/include/connection.hpp b/include/connection.hpp
index fcb2a23..2469738 100644
--- a/include/connection.hpp
+++ b/include/connection.hpp
@@ -98,6 +98,13 @@ public:
return get(endpoint, {});
}
+ /*! @copydoc CURLWrapper::set_proxy(string_view)
+ *
+ * Sets also the proxy for the Instance you used to initialize this
+ * Connection.
+ */
+ void set_proxy(const string_view proxy);
+
private:
Instance &_instance;
const string_view _baseuri;
diff --git a/include/curl_wrapper.hpp b/include/curl_wrapper.hpp
index ecc30e1..faf79a5 100644
--- a/include/curl_wrapper.hpp
+++ b/include/curl_wrapper.hpp
@@ -127,6 +127,18 @@ public:
return _connection;
}
+ /*!
+ * @brief Set the proxy to use.
+ *
+ * See [CURLOPT_PROXY(3)]
+ * (https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html).
+ *
+ * @param proxy Examples: "socks4a://127.0.0.1:9050", "http://[::1]:3128".
+ *
+ * @since 0.1.0
+ */
+ void set_proxy(const string_view proxy);
+
protected:
/*!
* @brief Make a HTTP request.