Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
spacetc62 committed Sep 14, 2017
2 parents 0f67dfe + 0ed5997 commit ee259b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ MQTT.prototype.connect = function(options, callback) {
var prefixPort = transportPrefixes[options.transport] ||
transportPrefixes.tls;

var url = prefixPort.prefix + config.mqttEndpoint;
var url = prefixPort.prefix + (options.mqttEndpoint || config.mqttEndpoint);

callback = callback || function() {};

Expand All @@ -63,7 +63,7 @@ MQTT.prototype.connect = function(options, callback) {
url, { clientId: options.id,
username: options.key,
password: options.secret,
port: prefixPort.port });
port: options.port || prefixPort.port });

this.client.on('connect', (function() {
debug('MQTT successfully connected to ' + url);
Expand Down

0 comments on commit ee259b0

Please sign in to comment.