diff --git a/CHANGELOG.md b/CHANGELOG.md index 68a94269..75c89c6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ # Change log for amqplib -## Chagnes in v0.10.0 +## Changes in v0.10.1 + + git log v0.9.1..v0.10.0 + + * Allow servername to be specified via socket options as discussed in as discussed in + [issue 697](https://github.com/squaremo/amqp.node/issues/697) + +## Changes in v0.10.0 + + git log v0.9.1..v0.10.0 + * Use Native promises ([PR 689](https://github.com/amqp-node/amqplib/pull/689), thank you @mohd-akram and @kibertoad) diff --git a/lib/connect.js b/lib/connect.js index 478dd76c..afbefadf 100644 --- a/lib/connect.js +++ b/lib/connect.js @@ -106,7 +106,7 @@ function connect(url, socketOptions, openCallback) { if (typeof url === 'object') { protocol = (url.protocol || 'amqp') + ':'; sockopts.host = url.hostname; - sockopts.servername = url.hostname; + sockopts.servername = sockopts.servername || url.hostname; sockopts.port = url.port || ((protocol === 'amqp:') ? 5672 : 5671); var user, pass; @@ -131,7 +131,7 @@ function connect(url, socketOptions, openCallback) { var parts = URL(url, true); // yes, parse the query string protocol = parts.protocol; sockopts.host = parts.hostname; - sockopts.servername = parts.hostname; + sockopts.servername = sockopts.servername || parts.hostname; sockopts.port = parseInt(parts.port) || ((protocol === 'amqp:') ? 5672 : 5671); var vhost = parts.pathname ? parts.pathname.substr(1) : null; fields = openFrames(vhost, parts.query, sockopts.credentials || credentialsFromUrl(parts), extraClientProperties); diff --git a/package-lock.json b/package-lock.json index decc1139..52e39d5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "amqplib", - "version": "0.9.1", + "version": "0.10.0", "license": "MIT", "dependencies": { "bitsyntax": "~0.1.0",