0
votes

I have problem with connection to RabbitMQ server (version: 3.8.2, erlang version: 22.2.8) by JS (on browser) webstomp. I'm using stomp.js.

I'm using example from here: https://github.com/rabbitmq/rabbitmq-web-stomp-examples/blob/master/priv/echo.html

I've done everything like is described here: https://www.rabbitmq.com/web-stomp.html

I've set permissions to my user using this: sudo rabbitmqctl set_permissions -p / user ".*" ".*" ".*"

I've set tags to my user using this: sudo rabbitmqctl set_user_tags user management

I've already checked these solutions: Failing to connect RabbitMQ through a EasyNetQ, getting access refused for user guest and RabbitMQ - access to vhost 'XXX' refused for user 'guest', and others that I found in google.

My configuration for rabbitmq_web_stomp:

{rabbitmq_web_stomp,
      [
       {tcp_config, [{port, 15674}
                    ]
       },
       {use_http_auth, true},
       {ssl_config, [{port,       15673},
                     {backlog,    1024},
                     {cacertfile,"path/to/cert"},
                     {certfile,"path/to/cert"},
                     {keyfile,"path/to/cert"},
                     {password,  "pass"}
                    ]
      }
     ]
  },

I always get the same response from server:

Opening Web Socket...
Web Socket Opened...
>>> CONNECT login:user passcode:pass host:/ accept-version:1.1,1.0 heart-beat:10000,10000 
<<< ERROR message:Bad CONNECT content-type:text/plain version:1.0,1.1,1.2 content-length:32 Access refused for user 'guest' 
Whoops! Lost connection to ws://ip.addres/ws

I have access (for this user) to the server by .NET Core client in C# and by Management Plugin

Thanks for help!

1

1 Answers

0
votes

I found the solution. I don't exactly sure why it works but it was enough to remove the {use_http_auth, true} from configuration. After that there was no problem with connection from JS from browser.