Kurlyk
Loading...
Searching...
No Matches
kurlyk::ProxyConfig Struct Reference

Stores proxy server, authentication, and transport settings. More...

#include <ProxyConfig.hpp>

Public Member Functions

 ProxyConfig ()
 Constructs an empty HTTP proxy configuration.
 ProxyConfig (std::string server, std::string auth, ProxyType type=ProxyType::PROXY_HTTP)
 Constructs a proxy configuration with server and authentication values.
void set_proxy (const std::string &ip, int port, ProxyType type=ProxyType::PROXY_HTTP)
 Sets the proxy server address and transport type.
void set_proxy (const std::string &ip, int port, const std::string &username, const std::string &password, ProxyType type=ProxyType::PROXY_HTTP)
 Sets the proxy server and authentication values.
void set_proxy_auth (const std::string &username, const std::string &password)
 Sets proxy authentication credentials.
std::string get_ip () const
 Returns the host part of the proxy server address.
int get_port () const
 Returns the proxy port.
std::string get_username () const
 Returns the proxy username.
std::string get_password () const
 Returns the proxy password.
bool is_valid () const
 Checks whether the proxy server address is valid.

Public Attributes

std::string proxy_server
 Proxy address in host:port format.
std::string proxy_auth
 Proxy authentication in username:password format.
ProxyType proxy_type
 Proxy transport type.
bool use
 Indicates whether the proxy is enabled.

Detailed Description

Stores proxy server, authentication, and transport settings.

Definition at line 23 of file ProxyConfig.hpp.

Constructor & Destructor Documentation

◆ ProxyConfig() [1/2]

kurlyk::ProxyConfig::ProxyConfig ( )
inline

Constructs an empty HTTP proxy configuration.

Definition at line 30 of file ProxyConfig.hpp.

◆ ProxyConfig() [2/2]

kurlyk::ProxyConfig::ProxyConfig ( std::string server,
std::string auth,
ProxyType type = ProxyType::PROXY_HTTP )
inline

Constructs a proxy configuration with server and authentication values.

Parameters
serverProxy server address.
authProxy authentication credentials.
typeProxy transport type.

Definition at line 37 of file ProxyConfig.hpp.

Member Function Documentation

◆ get_ip()

std::string kurlyk::ProxyConfig::get_ip ( ) const
inline

Returns the host part of the proxy server address.

Returns
Host string, or an empty string when the address is malformed.

Definition at line 77 of file ProxyConfig.hpp.

◆ get_password()

std::string kurlyk::ProxyConfig::get_password ( ) const
inline

Returns the proxy password.

Returns
Password string, or an empty string when credentials are absent.

Definition at line 106 of file ProxyConfig.hpp.

◆ get_port()

int kurlyk::ProxyConfig::get_port ( ) const
inline

Returns the proxy port.

Returns
Port number, or 0 when the address is malformed.

Definition at line 85 of file ProxyConfig.hpp.

◆ get_username()

std::string kurlyk::ProxyConfig::get_username ( ) const
inline

Returns the proxy username.

Returns
Username string, or an empty string when credentials are absent.

Definition at line 98 of file ProxyConfig.hpp.

◆ is_valid()

bool kurlyk::ProxyConfig::is_valid ( ) const
inline

Checks whether the proxy server address is valid.

Returns
True when a host and a port are present.

Definition at line 114 of file ProxyConfig.hpp.

◆ set_proxy() [1/2]

void kurlyk::ProxyConfig::set_proxy ( const std::string & ip,
int port,
const std::string & username,
const std::string & password,
ProxyType type = ProxyType::PROXY_HTTP )
inline

Sets the proxy server and authentication values.

Parameters
ipProxy server host or IP address.
portProxy server port.
usernameProxy username.
passwordProxy password.
typeProxy transport type.

Definition at line 58 of file ProxyConfig.hpp.

◆ set_proxy() [2/2]

void kurlyk::ProxyConfig::set_proxy ( const std::string & ip,
int port,
ProxyType type = ProxyType::PROXY_HTTP )
inline

Sets the proxy server address and transport type.

Parameters
ipProxy server host or IP address.
portProxy server port.
typeProxy transport type.

Definition at line 47 of file ProxyConfig.hpp.

◆ set_proxy_auth()

void kurlyk::ProxyConfig::set_proxy_auth ( const std::string & username,
const std::string & password )
inline

Sets proxy authentication credentials.

Parameters
usernameProxy username.
passwordProxy password.

Definition at line 71 of file ProxyConfig.hpp.

Member Data Documentation

◆ proxy_auth

std::string kurlyk::ProxyConfig::proxy_auth

Proxy authentication in username:password format.

Definition at line 25 of file ProxyConfig.hpp.

◆ proxy_server

std::string kurlyk::ProxyConfig::proxy_server

Proxy address in host:port format.

Definition at line 24 of file ProxyConfig.hpp.

◆ proxy_type

ProxyType kurlyk::ProxyConfig::proxy_type

Proxy transport type.

Definition at line 26 of file ProxyConfig.hpp.

◆ use

bool kurlyk::ProxyConfig::use

Indicates whether the proxy is enabled.

Definition at line 27 of file ProxyConfig.hpp.


The documentation for this struct was generated from the following file: