Websocket client configuration class, used to set the possible configuration options used to create an websocket_client instance.
More...
#include <ws_client.h>
Websocket client configuration class, used to set the possible configuration options used to create an websocket_client instance.
web::websockets::client::websocket_client_config::websocket_client_config |
( |
| ) |
|
|
inline |
Creates a websocket client configuration with default settings.
_ASYNCRTIMP void web::websockets::client::websocket_client_config::add_subprotocol |
( |
const ::utility::string_t & |
name | ) |
|
Adds a subprotocol to the request headers.
- Parameters
-
name | The 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.
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.
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
-
cred | The client credentials. |
void web::websockets::client::websocket_client_config::set_proxy |
( |
const web_proxy & |
proxy | ) |
|
|
inline |
Set the web proxy object
- Parameters
-
proxy | The 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
-
name | The 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: