summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
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.
2; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef CMD_H
#define CMD_H

typedef void (*cgit_cmd_fn)(struct cgit_context *ctx);

struct cgit_cmd {
	const char *name;
	cgit_cmd_fn fn;
	unsigned int want_repo:1,
		want_layout:1,
		want_vpath:1,
		is_clone:1;
};

extern struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx);

#endif /* CMD_H */