mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 01:03:01 +08:00
* Refactor Unit Tests * Add new certificate provider interface instead of read only certificates list. * Update ReleaseNotes.md * Fix Unit Tests * Fix build * unit testing hot swappable certificates (#1787) * Move test classes to correct namespace * Apply code style --------- Co-authored-by: Sean Hanna <hannasm@users.noreply.github.com>
67 lines
2.1 KiB
C#
67 lines
2.1 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace MQTTnet.Client
|
|
{
|
|
public sealed class MqttClientWebSocketProxyOptionsBuilder
|
|
{
|
|
readonly MqttClientWebSocketProxyOptions _proxyOptions = new MqttClientWebSocketProxyOptions();
|
|
|
|
public MqttClientWebSocketProxyOptionsBuilder WithAddress(string address)
|
|
{
|
|
_proxyOptions.Address = address;
|
|
return this;
|
|
}
|
|
|
|
public MqttClientWebSocketProxyOptionsBuilder WithUsername(string username)
|
|
{
|
|
_proxyOptions.Username = username;
|
|
return this;
|
|
}
|
|
|
|
public MqttClientWebSocketProxyOptionsBuilder WithPassword(string password)
|
|
{
|
|
_proxyOptions.Password = password;
|
|
return this;
|
|
}
|
|
|
|
public MqttClientWebSocketProxyOptionsBuilder WithDomain(string domain)
|
|
{
|
|
_proxyOptions.Domain = domain;
|
|
return this;
|
|
}
|
|
|
|
public MqttClientWebSocketProxyOptionsBuilder WithBypassOnLocal(bool bypassOnLocal = true)
|
|
{
|
|
_proxyOptions.BypassOnLocal = bypassOnLocal;
|
|
return this;
|
|
}
|
|
|
|
public MqttClientWebSocketProxyOptionsBuilder WithBypassList(string[] bypassList)
|
|
{
|
|
_proxyOptions.BypassList = bypassList;
|
|
return this;
|
|
}
|
|
|
|
public MqttClientWebSocketProxyOptionsBuilder WithBypassList(IEnumerable<string> bypassList)
|
|
{
|
|
_proxyOptions.BypassList = bypassList?.ToArray();
|
|
return this;
|
|
}
|
|
|
|
public MqttClientWebSocketProxyOptionsBuilder WithUseDefaultCredentials(bool useDefaultCredentials = true)
|
|
{
|
|
_proxyOptions.UseDefaultCredentials = useDefaultCredentials;
|
|
return this;
|
|
}
|
|
|
|
public MqttClientWebSocketProxyOptions Build()
|
|
{
|
|
return _proxyOptions;
|
|
}
|
|
}
|
|
} |