postwait / node-amqp

[UNMAINTAINED] node-amqp is an AMQP client for nodejs
MIT License
1.69k stars 357 forks source link

accept different ports for multiple hosts #367

Closed wei-lee closed 9 years ago

wei-lee commented 9 years ago

At the moment, the module requires all the hosts to have amqp server running on the same port. However. this might not be the case.

This change allows to specify different port for each server. E.g.

var connection = amqp.createConnection({host: ['www.server1.com', 'www.server2.com:5673']});

The default server port will still be used if no port is specified in the host URLs.

wei-lee commented 9 years ago

@postwait Thanks for pointing out the issue. Now using URL.parse instead.