diff --git a/lib/connect.js b/lib/connect.js index 6c835cb2..714d8cb2 100644 --- a/lib/connect.js +++ b/lib/connect.js @@ -105,9 +105,9 @@ function connect(url, socketOptions, openCallback) { var protocol, fields; if (typeof url === 'object') { - protocol = (url.protocol || 'amqp') + ':'; - sockopts.host = url.hostname; - sockopts.port = url.port || ((protocol === 'amqp:') ? 5672 : 5671); + protocol = (url.protocol || 'amqp') + ':'; + sockopts.host = url.hostname; + sockopts.port = url.port || ((protocol === 'amqp:') ? 5672 : 5671); var user, pass; if (!url.username) {