diff --git a/documents/MQTT5_Userguide.md b/documents/MQTT5_Userguide.md index 83cab00b4..0f476dd2d 100644 --- a/documents/MQTT5_Userguide.md +++ b/documents/MQTT5_Userguide.md @@ -16,7 +16,7 @@ - [MQTT over Websockets with Sigv4 authentication](#mqtt-over-websockets-with-sigv4-authentication) - [Direct MQTT with Custom Authentication](#direct-mqtt-with-custom-authentication) - [MQTT over Websockets with Cognito](#mqtt-over-websockets-with-cognito) - + [Connecting using an HTTP Proxy](#connecting-using-an-http-proxy) + + [Adding an HTTP Proxy](#adding-an-http-proxy) + [Client Operations](#client-operations) - [Subscribe](#subscribe) - [Unsubscribe](#unsubscribe) @@ -504,7 +504,7 @@ To create a MQTT5 builder configured for this connection, see the following code **Note**: A Cognito identity ID is different from a Cognito identity pool ID and trying to connect with a Cognito identity pool ID will not work. If you are unable to connect, make sure you are passing a Cognito identity ID rather than a Cognito identity pool ID. -## Connecting using an HTTP Proxy +## Adding an HTTP Proxy No matter what your connection transport or authentication method is, you may connect through an HTTP proxy by applying proxy configuration to the builder: diff --git a/samples/mqtt5/mqtt5_pubsub/README.md b/samples/mqtt5/mqtt5_pubsub/README.md index 5e24925a9..e77689391 100644 --- a/samples/mqtt5/mqtt5_pubsub/README.md +++ b/samples/mqtt5/mqtt5_pubsub/README.md @@ -70,41 +70,12 @@ You can also pass a Certificate Authority file (CA) if your certificate and key ./mqtt5_pubsub --endpoint --cert --key --topic --ca_file ``` ## Alternate Authentication Methods supported by AWS IoT Core -* [Direct MQTT with X509-based mutual TLS](#direct-mqtt-with-x509-based-mutual-tls) -* [MQTT over Websockets with Sigv4 authentication](#mqtt-over-websockets-with-sigv4-authentication) -* [Direct MQTT with Custom Authentication](#direct-mqtt-with-custom-authentication) -* [MQTT over Websockets with Cognito](#mqtt-over-websockets-with-cognito) - -## Connecting using an HTTP Proxy - -No matter what your connection transport or authentication method is, you may connect through an HTTP proxy by applying proxy configuration to the builder: - -```cpp - // Create a Client using Mqtt5ClientBuilder - Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithXXXXX( ... ); - - Http::HttpClientConnectionProxyOptions proxyOptions; - proxyOptions.HostName = ""; - proxyOptions.Port = ; - builder->WithHttpProxyOptions(proxyOptions); - - /* You can setup other client options and lifecycle event callbacks before call builder->Build(). - ** Once the the client get built, you could no longer update the client options or connection options - ** on the created client. - */ - - // Build Mqtt5Client - std::shared_ptr mqtt5Client = builder->Build(); - - if (mqtt5Client == nullptr) - { - fprintf(stdout, "Client creation failed.\n"); - return -1; - } - -``` - -SDK Proxy support also includes support for basic authentication and TLS-to-proxy. SDK proxy support does not include any additional proxy authentication methods (kerberos, NTLM, etc...) nor does it include non-HTTP proxies (SOCKS5, for example). +* Connection Types + + [Direct MQTT with X509-based mutual TLS](#direct-mqtt-with-x509-based-mutual-tls) + + [MQTT over Websockets with Sigv4 authentication](#mqtt-over-websockets-with-sigv4-authentication) + + [Direct MQTT with Custom Authentication](#direct-mqtt-with-custom-authentication) + + [MQTT over Websockets with Cognito](#mqtt-over-websockets-with-cognito) +* [Adding an HTTP Proxy](#adding-an-http-proxy) ### Direct MQTT with X509-based mutual TLS @@ -296,4 +267,35 @@ To create a MQTT5 builder configured for this connection, see the following code ``` -**Note**: A Cognito identity ID is different from a Cognito identity pool ID and trying to connect with a Cognito identity pool ID will not work. If you are unable to connect, make sure you are passing a Cognito identity ID rather than a Cognito identity pool ID. \ No newline at end of file +**Note**: A Cognito identity ID is different from a Cognito identity pool ID and trying to connect with a Cognito identity pool ID will not work. If you are unable to connect, make sure you are passing a Cognito identity ID rather than a Cognito identity pool ID. + +## Adding an HTTP Proxy + +No matter what your connection transport or authentication method is, you may connect through an HTTP proxy by applying proxy configuration to the builder: + +```cpp + // Create a Client using Mqtt5ClientBuilder + Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithXXXXX( ... ); + + Http::HttpClientConnectionProxyOptions proxyOptions; + proxyOptions.HostName = ""; + proxyOptions.Port = ; + builder->WithHttpProxyOptions(proxyOptions); + + /* You can setup other client options and lifecycle event callbacks before call builder->Build(). + ** Once the the client get built, you could no longer update the client options or connection options + ** on the created client. + */ + + // Build Mqtt5Client + std::shared_ptr mqtt5Client = builder->Build(); + + if (mqtt5Client == nullptr) + { + fprintf(stdout, "Client creation failed.\n"); + return -1; + } + +``` + +SDK Proxy support also includes support for basic authentication and TLS-to-proxy. SDK proxy support does not include any additional proxy authentication methods (kerberos, NTLM, etc...) nor does it include non-HTTP proxies (SOCKS5, for example). \ No newline at end of file