Skip to content

Commit

Permalink
Apply SecurityOptions to WebSocket4Net connections using MsgPack
Browse files Browse the repository at this point in the history
serialization, not just Json
  • Loading branch information
Tracy Harton committed May 17, 2018
1 parent 4bfbabc commit 08623f2
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,26 @@ private IControlledWampConnection<TMessage> GetConnectionFactory<TMessage>(IWamp

protected IControlledWampConnection<TMessage> CreateBinaryConnection<TMessage>(IWampBinaryBinding<TMessage> binaryBinding)
{
return new WebSocket4NetBinaryConnection<TMessage>(mWebSocketFactory(binaryBinding.Name), binaryBinding);
return new WebSocket4NetBinaryConnection<TMessage>(ActivateWebSocket(binaryBinding), binaryBinding);
}

protected IControlledWampConnection<TMessage> CreateTextConnection<TMessage>(IWampTextBinding<TMessage> textBinding)
{
return new WebSocket4NetTextConnection<TMessage>(ActivateWebSocket(textBinding), textBinding);
}

private WebSocket ActivateWebSocket<TMessage>(IWampBinaryBinding<TMessage> binaryBinding)
{
WebSocket webSocket = mWebSocketFactory(binaryBinding.Name);

if (SecurityOptionsConfigureAction != null)
{
SecurityOptionsConfigureAction(webSocket.Security);
}

return webSocket;
}

private WebSocket ActivateWebSocket<TMessage>(IWampTextBinding<TMessage> textBinding)
{
WebSocket webSocket = mWebSocketFactory(textBinding.Name);
Expand Down

0 comments on commit 08623f2

Please sign in to comment.