Skip to content

Commit

Permalink
Merge branch 'develop' into feature/MQTTv5
Browse files Browse the repository at this point in the history
  • Loading branch information
chkr1011 committed Dec 22, 2018
2 parents 45df33c + ba4fdfb commit 38b215e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Collections.Generic;
using System.Net;

namespace MQTTnet.Client
{
public class MqttClientOptionsBuilderWebSocketParameters
{
public IDictionary<string, string> RequestHeaders { get; set; }

public CookieContainer CookieContainer { get; set; }
}
}
6 changes: 4 additions & 2 deletions Source/MQTTnet/Client/Options/MqttClientOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,13 @@ public MqttClientOptionsBuilder WithProxy(string address, string username = null
return this;
}

public MqttClientOptionsBuilder WithWebSocketServer(string uri)
public MqttClientOptionsBuilder WithWebSocketServer(string uri, MqttClientOptionsBuilderWebSocketParameters parameters = null)
{
_webSocketOptions = new MqttClientWebSocketOptions
{
Uri = uri
Uri = uri,
RequestHeaders = parameters?.RequestHeaders,
CookieContainer = parameters?.CookieContainer
};

return this;
Expand Down

0 comments on commit 38b215e

Please sign in to comment.