Skip to content

Commit

Permalink
haha
Browse files Browse the repository at this point in the history
  • Loading branch information
sbSteveK committed Jan 29, 2024
1 parent 9d608de commit 6a76cd2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 38 deletions.
4 changes: 2 additions & 2 deletions documents/MQTT5_Userguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:

Expand Down
74 changes: 38 additions & 36 deletions samples/mqtt5/mqtt5_pubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,41 +70,12 @@ You can also pass a Certificate Authority file (CA) if your certificate and key
./mqtt5_pubsub --endpoint <endpoint> --cert <path to the certificate> --key <path to the private key> --topic <topic name> --ca_file <path to root CA>
```
## 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 = "<proxyHost>";
proxyOptions.Port = <proxyPort>;
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<Aws::Crt::Mqtt5Client> 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

Expand Down Expand Up @@ -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.
**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 = "<proxyHost>";
proxyOptions.Port = <proxyPort>;
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<Aws::Crt::Mqtt5Client> 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).

0 comments on commit 6a76cd2

Please sign in to comment.