After we write a program, comp-demo.js, we can execute this program. Now you can run the program. Type this command:
$ node comp-demo.js
Make sure all certificate files are on the same path with comp-demo.js. If successful, you should see the connected state and receive the incoming message:
![](https://static.packt-cdn.com/products/9781788396110/graphics/assets/e69ac495-045d-4459-8876-7f12ebe807ca.png)
You can also verify on AWS IoT Management Console about this transaction:
![](https://static.packt-cdn.com/products/9781788396110/graphics/assets/cccd5bbd-dfe8-4a19-957b-fb44d622f6ef.png)