amqp / rhea

A reactive messaging library based on the AMQP protocol
Apache License 2.0
273 stars 80 forks source link

Connection RabbitMQ through websocket #409

Open ahsonnenberg opened 9 months ago

ahsonnenberg commented 9 months ago

Hello, would appreciate some help please. I have connected succesfully to RabbitMQ from nodes. Now I am trying to do the same from a browser. However, RabbitMQ closes the connection claiming a bad header ({bad_header,<<"GET / HT">>})

code to connect: var ws = client.websocket_connect(WebSocket); var connection = client.connect({"connection_details":ws("ws://localhost:5672", ["binary", "AMQPWSB10", "amqp"])}); connection.open_receiver("demijne");

Am I missing something? Thanks in advance, Tonny

grs commented 9 months ago

The server/broker needs to be able to handle a websocket request. I don't believe RabbitMQ will do that on the standard 5672 port. Looking at the supported protocols, they don't mention support for AMQP over websockets at all: https://www.rabbitmq.com/protocols.html

I would check with RabbitMQ team if this is something they support (and if so how to configure)

ahsonnenberg commented 9 months ago

thank you grs for your quick response. based on your comment I changed to Apache Artemis, and I now see a connection. thanks a lot. have a nice day. Tonny