Skip to main content

mqttclient.url()

Retrieve the URL of the broker to which an MQTT client is connected

Availability

Agent

Returns

String — The URL of the MQTT broker

Description

This method allows you to retrieve the URL of the MQTT broker to which the mqttclient object is connected and was provided when the connection attempt was made (ie. by using the imp API method mqttclient.connect()).

The call returns a string which will be prefixed tcp:// for unencrypted connections, or ssl:// for encrypted connections.