Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::common::ProxyConfig Struct Reference

HTTP(S) or SOCKS5 proxy. More...

#include <config.hpp>

Public Attributes

std::string host
std::uint16_t port = 0
ProxyProtocol protocol = ProxyProtocol::Http
std::optional< ProxyAuth > auth

Detailed Description

HTTP(S) or SOCKS5 proxy.

  • HTTP(S): requests to an https:// base path go through a CONNECT tunnel; requests to an http:// base path are sent to the proxy in absolute form. With ProxyProtocol::Https, the connection to the proxy itself also uses TLS. The proxy certificate is verified with the same trust store and agent hook as the target's. auth is sent as Basic credentials.
  • SOCKS5 (RFC 1928), over plain TCP, for REST and WebSockets alike: the connection to the target is tunnelled, and TLS and the WebSocket upgrade run end to end over it. Socks5 resolves the target's host name in the client and gives the proxy its address; Socks5h gives the proxy the host name to resolve. IP literals are always sent as addresses. auth is sent as username / password (RFC 1929), each at most 255 bytes, if the proxy asks for it; without auth only "no authentication" is offered. A refusal by the proxy or the target is a network error whose transport error maps the SOCKS reply (e.g. connection_refused, host_unreachable, access_denied for failed authentication).

Member Data Documentation

◆ host

std::string binance::common::ProxyConfig::host

◆ port

std::uint16_t binance::common::ProxyConfig::port = 0

◆ protocol

ProxyProtocol binance::common::ProxyConfig::protocol = ProxyProtocol::Http

◆ auth

std::optional<ProxyAuth> binance::common::ProxyConfig::auth