OpenVPN 3 Core Library
|
Host and port configuration for proxy connections. More...
#include <capture.hpp>
Public Member Functions | |
std::string | to_string () const |
Converts the host and port to a string representation. | |
bool | defined () const |
Checks if the proxy configuration is defined. | |
void | validate (const std::string &title) const |
Validates the host and port. | |
Json::Value | to_json () const |
Converts the object to a JSON representation. | |
void | from_json (const Json::Value &root, const std::string &title) |
Populates the object from a JSON representation. | |
Public Attributes | |
std::string | host |
int | port = 0 |
Host and port configuration for proxy connections.
This class stores and validates a host:port combination that represents a proxy server. It provides methods to check validity, convert to string representation, and serialize/deserialize from JSON (when available).
Definition at line 483 of file capture.hpp.
|
inline |
Checks if the proxy configuration is defined.
A proxy is considered defined if the host is not empty.
true
if the host is not empty, false
otherwise. Definition at line 506 of file capture.hpp.
|
inline |
Populates the object from a JSON representation.
Extracts "host" and "port" fields from a JSON object.
root | The JSON object to parse. |
title | A context string used in error messages during parsing. |
Definition at line 548 of file capture.hpp.
|
inline |
Converts the object to a JSON representation.
Creates a JSON object with "host" and "port" fields.
Definition at line 533 of file capture.hpp.
|
inline |
Converts the host and port to a string representation.
Creates a string in the format "host port".
Definition at line 494 of file capture.hpp.
|
inline |
Validates the host and port.
If the proxy is defined, validates both the host name and port number using the HostPort validation methods.
title | A context string used in error messages for validation. |
Definition at line 518 of file capture.hpp.
std::string openvpn::TunBuilderCapture::ProxyHostPort::host |
Definition at line 486 of file capture.hpp.
int openvpn::TunBuilderCapture::ProxyHostPort::port = 0 |
Definition at line 487 of file capture.hpp.