(cobra) IXCobraConfig struct has tlsOptions and per message deflate options

This commit is contained in:
Benjamin Sergeant
2020-03-11 12:40:32 -07:00
parent 0a11132b07
commit 6a4d69afc5
13 changed files with 50 additions and 66 deletions

View File

@ -6,6 +6,9 @@
#pragma once
#include <ixwebsocket/IXWebSocketPerMessageDeflateOptions.h>
#include <ixwebsocket/IXSocketTLSOptions.h>
namespace ix
{
struct CobraConfig
@ -14,6 +17,8 @@ namespace ix
std::string endpoint;
std::string rolename;
std::string rolesecret;
WebSocketPerMessageDeflateOptions webSocketPerMessageDeflateOptions;
SocketTLSOptions socketTLSOptions;
CobraConfig(const std::string& a = std::string(),
const std::string& e = std::string(),
@ -28,4 +33,3 @@ namespace ix
}
};
} // namespace ix

View File

@ -276,6 +276,16 @@ namespace ix
_webSocket->setPingTimeout(3 * kPingIntervalSecs);
}
void CobraConnection::configure(const ix::CobraConfig& config)
{
configure(config.appkey,
config.endpoint,
config.rolename,
config.rolesecret,
config.webSocketPerMessageDeflateOptions,
config.socketTLSOptions);
}
//
// Handshake message schema.
//

View File

@ -69,6 +69,8 @@ namespace ix
const WebSocketPerMessageDeflateOptions& webSocketPerMessageDeflateOptions,
const SocketTLSOptions& socketTLSOptions);
void configure(const ix::CobraConfig& config);
/// Set the traffic tracker callback
static void setTrafficTrackerCallback(const TrafficTrackerCallback& callback);