Add client handshake extra headers (#105)
Even though 6455 defines all the necessary headers needed for client/server handshake, in practice most of the cases websocket servers expect few more headers. Therefore adding this functionality.
This commit is contained in:
committed by
Benjamin Sergeant
parent
ff75846d2d
commit
93debc00dc
@ -127,8 +127,10 @@ namespace ix
|
||||
}
|
||||
|
||||
// Client
|
||||
WebSocketInitResult WebSocketTransport::connectToUrl(const std::string& url,
|
||||
int timeoutSecs)
|
||||
WebSocketInitResult WebSocketTransport::connectToUrl(
|
||||
const std::string& url,
|
||||
const std::unordered_map<std::string, std::string>& headers,
|
||||
int timeoutSecs)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_socketMutex);
|
||||
|
||||
@ -156,8 +158,8 @@ namespace ix
|
||||
_perMessageDeflateOptions,
|
||||
_enablePerMessageDeflate);
|
||||
|
||||
auto result = webSocketHandshake.clientHandshake(url, host, path, port,
|
||||
timeoutSecs);
|
||||
auto result = webSocketHandshake.clientHandshake(url, headers, host, path,
|
||||
port, timeoutSecs);
|
||||
if (result.success)
|
||||
{
|
||||
setReadyState(ReadyState::OPEN);
|
||||
|
Reference in New Issue
Block a user