C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Public Member Functions | List of all members
web::websockets::client::websocket_client_config Class Reference

Websocket client configuration class, used to set the possible configuration options used to create an websocket_client instance. More...

#include <ws_client.h>

Public Member Functions

 websocket_client_config ()
 Creates a websocket client configuration with default settings. More...
 
const web_proxyproxy () const
 Get the web proxy object More...
 
void set_proxy (const web_proxy &proxy)
 Set the web proxy object More...
 
const web::credentialscredentials () const
 Get the client credentials More...
 
void set_credentials (const web::credentials &cred)
 Set the client credentials More...
 
void disable_sni ()
 Disables Server Name Indication (SNI). Default is on. More...
 
bool is_sni_enabled () const
 Determines if Server Name Indication (SNI) is enabled. More...
 
void set_server_name (const utf8string &name)
 Sets the server host name to use for TLS Server Name Indication (SNI). More...
 
const utf8string & server_name () const
 Gets the server host name to usefor TLS Server Name Indication (SNI). More...
 
web::http::http_headersheaders ()
 Gets the headers of the HTTP request message used in the WebSocket protocol handshake. More...
 
const web::http::http_headersheaders () const
 Gets a const reference to the headers of the WebSocket protocol handshake HTTP message. More...
 
_ASYNCRTIMP void add_subprotocol (const ::utility::string_t &name)
 Adds a subprotocol to the request headers. More...
 
_ASYNCRTIMP std::vector<::utility::string_t > subprotocols () const
 Gets list of the specified subprotocols. More...
 

Detailed Description

Websocket client configuration class, used to set the possible configuration options used to create an websocket_client instance.

Constructor & Destructor Documentation

web::websockets::client::websocket_client_config::websocket_client_config ( )
inline

Creates a websocket client configuration with default settings.

Member Function Documentation

_ASYNCRTIMP void web::websockets::client::websocket_client_config::add_subprotocol ( const ::utility::string_t &  name)

Adds a subprotocol to the request headers.

Parameters
nameThe name of the subprotocol.

If additional subprotocols have already been specified, the new one will just be added.

const web::credentials& web::websockets::client::websocket_client_config::credentials ( ) const
inline

Get the client credentials

Returns
A reference to the client credentials.
void web::websockets::client::websocket_client_config::disable_sni ( )
inline

Disables Server Name Indication (SNI). Default is on.

web::http::http_headers& web::websockets::client::websocket_client_config::headers ( )
inline

Gets the headers of the HTTP request message used in the WebSocket protocol handshake.

Returns
HTTP headers for the WebSocket protocol handshake.

Use the

See also
http_headers::add Method

to fill in desired headers.

const web::http::http_headers& web::websockets::client::websocket_client_config::headers ( ) const
inline

Gets a const reference to the headers of the WebSocket protocol handshake HTTP message.

Returns
HTTP headers.
bool web::websockets::client::websocket_client_config::is_sni_enabled ( ) const
inline

Determines if Server Name Indication (SNI) is enabled.

Returns
True if enabled, false otherwise.
const web_proxy& web::websockets::client::websocket_client_config::proxy ( ) const
inline

Get the web proxy object

Returns
A reference to the web proxy object.
const utf8string& web::websockets::client::websocket_client_config::server_name ( ) const
inline

Gets the server host name to usefor TLS Server Name Indication (SNI).

Returns
Host name as a string.
void web::websockets::client::websocket_client_config::set_credentials ( const web::credentials cred)
inline

Set the client credentials

Parameters
credThe client credentials.
void web::websockets::client::websocket_client_config::set_proxy ( const web_proxy proxy)
inline

Set the web proxy object

Parameters
proxyThe web proxy object.
void web::websockets::client::websocket_client_config::set_server_name ( const utf8string &  name)
inline

Sets the server host name to use for TLS Server Name Indication (SNI).

By default the host name is set to the websocket URI host.

Parameters
nameThe host name to use, as a string.
_ASYNCRTIMP std::vector<::utility::string_t> web::websockets::client::websocket_client_config::subprotocols ( ) const

Gets list of the specified subprotocols.

Returns
Vector of all the subprotocols

If you want all the subprotocols in a comma separated string they can be directly looked up in the headers using 'Sec-WebSocket-Protocol'.


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