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

Configuration structure for connecting through a proxy server. More...

#include <ProxyConfig.hpp>

Public Member Functions

 ProxyConfig ()
 Default constructor.
 
 ProxyConfig (std::string server, std::string auth, ProxyType type)
 Constructs ProxyConfig with server and authentication.
 
void set_proxy (const std::string &ip, int port, ProxyType type)
 Sets the proxy server address.
 
void set_proxy (const std::string &ip, int port, const std::string &username, const std::string &password, ProxyType type=ProxyType::HTTP)
 Sets the proxy server address with authentication details and proxy type.
 
void set_proxy_auth (const std::string &username, const std::string &password)
 Sets proxy authentication credentials.
 
std::string get_ip () const
 Returns the proxy IP address (host part).
 
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 if the proxy configuration is valid (server field must not be empty).
 

Public Attributes

std::string proxy_server
 Proxy address in <ip:port> format.
 
std::string proxy_auth
 Proxy authentication in <username:password> format.
 
ProxyType proxy_type
 Proxy type (e.g., HTTP, SOCKS5).
 
bool use = false
 Whether to use proxy for connection.
 

Detailed Description

Configuration structure for connecting through a proxy server.

Definition at line 12 of file ProxyConfig.hpp.

Constructor & Destructor Documentation

◆ ProxyConfig() [1/2]

cryptox::ProxyConfig::ProxyConfig ( )
inline

Default constructor.

Definition at line 19 of file ProxyConfig.hpp.

◆ ProxyConfig() [2/2]

cryptox::ProxyConfig::ProxyConfig ( std::string server,
std::string auth,
ProxyType type )
inline

Constructs ProxyConfig with server and authentication.

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

Definition at line 26 of file ProxyConfig.hpp.

Member Function Documentation

◆ get_ip()

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

Returns the proxy IP address (host part).

Returns
Proxy IP as string, or empty string if not set or invalid.

Definition at line 64 of file ProxyConfig.hpp.

◆ get_password()

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

Returns the proxy password.

Returns
Password string, or empty if not set.

Definition at line 92 of file ProxyConfig.hpp.

◆ get_port()

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

Returns the proxy port.

Returns
Proxy port as integer, or 0 if invalid.

Definition at line 72 of file ProxyConfig.hpp.

◆ get_username()

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

Returns the proxy username.

Returns
Username string, or empty if not set.

Definition at line 84 of file ProxyConfig.hpp.

◆ is_valid()

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

Checks if the proxy configuration is valid (server field must not be empty).

Returns
True if proxy_server is non-empty, otherwise false.

Definition at line 100 of file ProxyConfig.hpp.

◆ set_proxy() [1/2]

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

Sets the proxy server address with authentication details and proxy type.

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

Definition at line 44 of file ProxyConfig.hpp.

◆ set_proxy() [2/2]

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

Sets the proxy server address.

Parameters
ipProxy server IP address.
portProxy server port.
typeProxy type.

Definition at line 33 of file ProxyConfig.hpp.

◆ set_proxy_auth()

void cryptox::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 58 of file ProxyConfig.hpp.

Member Data Documentation

◆ proxy_auth

std::string cryptox::ProxyConfig::proxy_auth

Proxy authentication in <username:password> format.

Definition at line 14 of file ProxyConfig.hpp.

◆ proxy_server

std::string cryptox::ProxyConfig::proxy_server

Proxy address in <ip:port> format.

Definition at line 13 of file ProxyConfig.hpp.

◆ proxy_type

ProxyType cryptox::ProxyConfig::proxy_type

Proxy type (e.g., HTTP, SOCKS5).

Definition at line 15 of file ProxyConfig.hpp.

◆ use

bool cryptox::ProxyConfig::use = false

Whether to use proxy for connection.

Definition at line 16 of file ProxyConfig.hpp.


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