Closed atodorov closed 1 year ago
Hello,
It's hard to say without more information, but Buster's version may be outdated, you could try by installing the last release. Remove your installed packages ulfius, yder and orcania first.
Also, you can't pass your message using a pipe, it must be in the program prompt, when the connection is opened, like in wscat
.
And finally, you can use the option --output-log-file=PATH
to specify a log file where you might have more information.
From the Buster .deb package:
# uwsc --add-header "Content-Type: application/json" ws://host.docker.internal:9944
Error connecting to websocket
After installing packages from the latest release:
# uwsc -v
0.12
# dpkg -S libulfius
libulfius: /usr/lib/libulfius.so.2.7.13
libulfius: /usr/lib/libulfius.so.2.7
libulfius: /usr/lib/pkgconfig/libulfius.pc
libulfius: /usr/lib/libulfius.so
# uwsc --add-header "Content-Type: application/json" ws://host.docker.internal:9944
Websocket connected, you can send text messages of maximum 256 characters.
To exit uwsc, type !q<enter>
> {"id": 1, "jsonrpc": "2.0", "method": "chain_getBlockHash", "params": [] }
Send '{"id": 1, "jsonrpc": "2.0", "method": "chain_getBlockHash", "params": [] }'
Server message: '{"jsonrpc":"2.0","result":"0xb7714675d7f94d616fce6e3480a106c049e665b4ecd06bd6d6ed9728374eb569","id":1}'
So it looks like the stock version in Buster is old. Closing!
Update: Updated to Debian 11 Bullseye and the stock .deb package there works for me too.
Describe the issue I have an application packaged inside a docker container which is failing to communicate to the host over Websocket (plain HTTP works). It's a JSON-RPC over HTTP + WS. This has nothing to do with uwsc, however in this setup I was using uwsc in order to debug the connection. Here's what I uncovered:
So two different clients trying to do the same thing. Any idea why
uwsc
fails butwscat
doesn't ?System (please complete the following information):
FROM buildpack-deps:buster-scm
)libulfius2.5:amd64 2.5.2-4+deb10u1
Additional context Add any other context about the problem here.