Skip to content

Commit 1ec6c54

Browse files
bretambroseelryno
andauthored
Proxy fix (#647)
Co-authored-by: Ryan Smith <ryan.smith@density.io>
1 parent d51a28b commit 1ec6c54

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

source/iot/Mqtt5Client.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,8 @@ namespace Aws
571571
m_options->WithConnectOptions(m_connectOptions);
572572
}
573573

574+
bool proxyOptionsSet = false;
575+
574576
if (m_websocketConfig.has_value())
575577
{
576578
auto websocketConfig = m_websocketConfig.value();
@@ -595,13 +597,20 @@ namespace Aws
595597
if (useWebsocketProxyOptions)
596598
{
597599
m_options->WithHttpProxyOptions(m_websocketConfig->ProxyOptions.value());
600+
proxyOptionsSet = true;
598601
}
599602
else if (m_proxyOptions.has_value())
600603
{
601604
m_options->WithHttpProxyOptions(m_proxyOptions.value());
605+
proxyOptionsSet = true;
602606
}
603607
}
604608

609+
if (m_proxyOptions.has_value() && !proxyOptionsSet)
610+
{
611+
m_options->WithHttpProxyOptions(m_proxyOptions.value());
612+
}
613+
605614
return Crt::Mqtt5::Mqtt5Client::NewMqtt5Client(*m_options, m_allocator);
606615
}
607616

0 commit comments

Comments
 (0)