Skip to content

Instantly share code, notes, and snippets.

@clarkmcc
Last active September 16, 2019 16:18
Show Gist options
  • Save clarkmcc/1419e7825c1e06df54c8f4f59a2b39da to your computer and use it in GitHub Desktop.
Save clarkmcc/1419e7825c1e06df54c8f4f59a2b39da to your computer and use it in GitHub Desktop.
AWS IoT Device - Connect over port 443
/**
* Creates a new instance of the iot.device class that we can connect to and listen on
* @private
* @type {*}
* @memberof Device
*/
private _device: any = iot.device({
keyPath: __dirname + "device.private.key",
certPath: __dirname + "device.cert.pem",
caPath: __dirname + "root-CA.crt", // https://www.amazontrust.com/repository/AmazonRootCA1.pem
clientId: "device",
host: "xxxxx-ats.iot.xxxxx.amazonaws.com",
ALPNProtocols: ["x-amzn-mqtt-ca"],
port: 443,
debug: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment