AWS IoT MQTT over WebSocket Protocol


I’ve been following the AWS IoT docs trying to get started with the MQTT tutorial at
to set up a WebSocket connection to AWS IoT in a web application. The first step is to initiate a WebSocket connection by making a GET request to an endpoint created by following the steps in the tutorial but I’m getting this error:

XMLHttpRequest cannot load <my endpoint> Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

I was wondering if anyone has encountered this error and if so, how they resolved it?

Here’s a link to the code


Here’s an example of how I’m opening the channel. I’m using Cognito unauth roles as a subscriber. I’m using the JS Paho client as well.

Leave a Reply