amazon web services – Golang Paho MQTT over Websocket

From the Eclipse Paho GoLang page

The type of connection required is specified by the scheme of the
connection URL set in the ClientOptions struct, for example:

  • tcp://mqtt.eclipseprojects.io:1883 – connect to mqtt.eclipseprojects.io on port 1883 using plain TCP
  • ws://mqtt.eclipseprojects.io:1883 – connect to mqtt.eclipseprojects.io on port 1883 using WebSockets
  • tls://mqtt.eclipseprojects.io:8883 – connect to mqtt.eclipseprojects.io on port 8883 using TLS (ssl:// and tcps:// are
    synonyms for tls://)

The second entry in the list suggests you just pas in the URL with the right schema ( ws:// or probably wss://)

Read more here: Source link