Can I specify RabbitMQ credentials in node.js?

So I never used rabbit.js myself, but after diving into the code, it seems to be using amqplib. The code that parses it can be seen here and it seems it's calling the standard nodejs URL module. So perhaps you can try something like this:

amqp://user:[email protected]/vhost

Hope it helps!

Cheers.


const amqp = require('amqplib/callback_api');

const opt = { credentials: require('amqplib').credentials.plain('user', 'password') };
amqp.connect('amqp://localhost', opt, (err, conn) => {});

//