Skip to content

Commit

Permalink
cleanup http proxy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerZhongAWS committed Dec 12, 2023
1 parent fb58d1f commit 1beb832
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion source/SharedCrtResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ int SharedCrtResourceManager::establishConnection(const PlainConfig &config)
TAG,
"Attempting to establish MQTT connection with proxy: %s:%u",
proxyOptions.HostName.c_str(),
proxyConfig.proxyPort.value());
proxyOptions.Port);

if (proxyConfig.httpProxyAuthEnabled)
{
Expand Down
8 changes: 3 additions & 5 deletions source/tunneling/SecureTunnelingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Aws
const int port,
const OnConnectionShutdownFn &onConnectionShutdown)
: mSharedCrtResourceManager(manager), mRootCa(rootCa.has_value() ? rootCa.value() : ""),
mAccessToken(accessToken), mEndpoint(endpoint), mPort(port), isHTTPProxyEnabled(false),
mAccessToken(accessToken), mEndpoint(endpoint), mPort(port),
mOnConnectionShutdown(onConnectionShutdown)
{
}
Expand All @@ -42,7 +42,7 @@ namespace Aws
const int port,
const OnConnectionShutdownFn &onConnectionShutdown)
: mSharedCrtResourceManager(manager), mProxyOptions(proxyOptions), mRootCa(rootCa.has_value() ? rootCa.value() : ""),
mAccessToken(accessToken), mEndpoint(endpoint), mPort(port), isHTTPProxyEnabled(true),
mAccessToken(accessToken), mEndpoint(endpoint), mPort(port),
mOnConnectionShutdown(onConnectionShutdown)
{
}
Expand Down Expand Up @@ -205,9 +205,7 @@ namespace Aws
const Aws::Iotsecuretunneling::OnStreamReset &onStreamReset,
const Aws::Iotsecuretunneling::OnSessionReset &onSessionReset)
{
// const Aws::Crt::Http::HttpClientConnectionProxyOptions& proxyOptions = mProxyOptions;

if (isHTTPProxyEnabled) {
if (mProxyOptions.HostName.length() > 0) {
LOGM_INFO(TAG, "Creating Secure Tunneling with proxy to: %s", mProxyOptions.HostName.c_str());
return std::make_shared<SecureTunnelWrapper>(
mSharedCrtResourceManager->getAllocator(),
Expand Down
5 changes: 0 additions & 5 deletions source/tunneling/SecureTunnelingContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,6 @@ namespace Aws
*/
uint16_t mPort{22};

/**
* \brief boolean for HTTP proxy enablement
*/
bool isHTTPProxyEnabled;

/**
* \brief Callback when the secure tunnel is shutdown
*/
Expand Down
7 changes: 0 additions & 7 deletions source/tunneling/SecureTunnelingFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,6 @@ namespace Aws
if (!config.tunneling.subscribeNotification)
{
auto context = createContext(*config.tunneling.destinationAccessToken, *config.tunneling.region, static_cast<uint16_t>(config.tunneling.port.value()));
// auto context = unique_ptr<SecureTunnelingContext>(new SecureTunnelingContext(
// mSharedCrtResourceManager,
// mRootCa,
// *config.tunneling.destinationAccessToken,
// GetEndpoint(*config.tunneling.region),
// static_cast<uint16_t>(config.tunneling.port.value()),
// bind(&SecureTunnelingFeature::OnConnectionShutdown, this, placeholders::_1)));
mContexts.push_back(std::move(context));
}
}
Expand Down

0 comments on commit 1beb832

Please sign in to comment.