Cannot connect to CoilMQ: "Failed to connect at web socket level"
See original GitHub issueI’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!
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
That’s heartwarming, thanks! I try to do my best, and this kind of message really motivates me to do more!
I hope you’ll find a nice alternative for this use case. Have a good one!
Now everything became clear thanks to you. I think I’d looking for some other solution for CoilMQ communication. I really appreciate your help and I’ll keep monitoring krossbow updates at least because we are using it in our main project and it works well. Also I really like how quick and good support are. Thanks a lot!