diff --git a/library/include/larra/proxy.hpp b/library/include/larra/proxy.hpp new file mode 100644 index 0000000..3f365ff --- /dev/null +++ b/library/include/larra/proxy.hpp @@ -0,0 +1,39 @@ +#pragma once +#include +#include + +namespace larra::xmpp { + +struct HttpProxy { + std::string hostname; + std::uint16_t port; + template + constexpr auto Hostname(this Self&& self, std::string hostname) -> HttpProxy { + return utils::FieldSetHelper::With<"hostname", HttpProxy>(std::forward(self), std::move(hostname)); + } + template + constexpr auto Port(this Self&& self, std::uint16_t port) -> HttpProxy { + return utils::FieldSetHelper::With<"port", HttpProxy>(std::forward(self), port); + } +}; + +struct Socks5Proxy { + std::string hostname; + std::uint16_t port; + template + constexpr auto Hostname(this Self&& self, std::string hostname) -> Socks5Proxy { + return utils::FieldSetHelper::With<"hostname", Socks5Proxy>(std::forward(self), std::move(hostname)); + } + template + constexpr auto Port(this Self&& self, std::uint16_t port) -> Socks5Proxy { + return utils::FieldSetHelper::With<"port", Socks5Proxy>(std::forward(self), port); + } +}; + +struct NoProxy {}; + +struct SystemConfiguredProxy {}; + +using Proxy = std::variant; + +} // namespace larra::xmpp