amqp-node / amqplib

AMQP 0-9-1 library and client for Node.JS

Home Page:https://amqp-node.github.io/amqplib/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question mark in password breaks connection string

aleybovich opened this issue · comments

When executing this line:

const conn = await amqp.connect(`amqp://${user}:${pass}@${host}:${port}`);

if pass contains a ? (e.g. abc?def) then only the part of the password before ? is being used, leading to authentication errors.

Any workaround?

Have you tried escaping it?

  const connection = await amqplib.connect('amqp://steve:pass%3Fword@localhost');

works for me