Esempio n. 1
0
        public MqttClientOptionsBuilder WithProxy(Action <MqttClientWebSocketProxyOptions> optionsBuilder)
        {
            if (optionsBuilder == null)
            {
                throw new ArgumentNullException(nameof(optionsBuilder));
            }

            _proxyOptions = new MqttClientWebSocketProxyOptions();
            optionsBuilder(_proxyOptions);
            return(this);
        }
        public MqttClientOptionsBuilder WithProxy(string address, string username = null, string password = null, string domain = null, bool bypassOnLocal = false, string[] bypassList = null)
        {
            _proxyOptions = new MqttClientWebSocketProxyOptions
            {
                Address       = address,
                Username      = username,
                Password      = password,
                Domain        = domain,
                BypassOnLocal = bypassOnLocal,
                BypassList    = bypassList
            };

            return(this);
        }