parse
Parse an MQTT endpoint from a URI string.
Supported schemes:
tcp://host:portormqtt://host:port— plain TCP (default port: 1883)ssl://host:portormqtts://host:portortls://host:port— TCP with TLS (default port: 8883)ws://host:port/path— plain WebSocketwss://host:port/path— WebSocket with TLS
Example
val tcp = MqttEndpoint.parse("tcp://broker.example.com:1883")
val tls = MqttEndpoint.parse("ssl://broker.example.com:8883")
val ws = MqttEndpoint.parse("wss://broker.example.com/mqtt")Content copied to clipboard
Parameters
uri
The URI to parse.
Throws
if the URI scheme is unsupported or the format is invalid.