diff --git a/src/adapters/mqtt/index.ts b/src/adapters/mqtt/index.ts index 3ba70ecca..95e428110 100644 --- a/src/adapters/mqtt/index.ts +++ b/src/adapters/mqtt/index.ts @@ -45,7 +45,7 @@ class MqttAdapter extends Adapter { this.client = mqtt.connect({ host: url.host, port: url.port || (url.protocol === 'mqtt:' ? 1883 : 8883), - protocol: url.protocol.substr(0, url.protocol.length - 1), + protocol: url.protocol.slice(0, url.protocol.length - 1), clientId: serverBinding && serverBinding.clientId, clean: serverBinding && serverBinding.cleanSession, will: serverBinding && serverBinding.will && {