Skip to content

Cannot connect to CoilMQ: "Failed to connect at web socket level" #261

Closed
@EugeneSid

Description

@EugeneSid

I'm using STOMP for interaction between android device and raspberry pi. As a server I have Coilmq STOMP server this installed on RPi4 and successfully tested with stomp.py - a python library of STOMP client.

By using krossbow STOMP client library I receive "GET" command only with URL and headers which doesn't have STOMP initial commands (STOMP or CONNECT) but instead it looks like WEB STOMP version:

b'GET /queue/camera HTTP/1.1\r\nHost: 172.18.5.38:61613\r\nAccept-Charset: UTF-8\r\nAccept: */*\r\nUpgrade: websocket\r\nConnection: upgrade\r\nSec-WebSocket-Key: ZDEzNzIyYzEwOGU5MDdkNw==\r\nSec-WebSocket-Version: 13\r\nUser-Agent: Ktor client\r\n\r\n'

And because of this I'm unable to connect to the server..
Android log info:

Failure(org.hildan.krossbow.stomp.WebSocketConnectionException: Failed to connect at web socket level to ws://172.18.5.38:61613/queue/cam)

The coilmq log shorted info:

Exception occurred during processing of request from ('172.18.4.14', 17474)
Traceback (most recent call last):
...
  File "/usr/local/lib/python3.9/dist-packages/coilmq/util/frames.py", line 51, in parse_headers
    return preamble_lines[0], OrderedDict([l.split(':') for l in preamble_lines[1:]])
ValueError: too many values to unpack (expected 2)

On the other hand, when I run python STOMP client, there is STOMP command and the message looks like:

b'STOMP\naccept-version:1.1\nlogin:admin\npasscode:password\n\n\x00'

And after that I'm successfully connected to the server.

Stomp client have been build on KtorWebSocketClient as in official documentation and using that I attempted to connect via local network.

Any Idea what I'm doing wrong? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions