Websoket doesn't connect

Hi everyone!

I'm trying to get some alerting information from my Grafana instance to Node-Red (3.0.2). So I'd like to use Websocket. But something doesn't work as expected:



 curl -i
HTTP/1.1 404 Not Found
Access-Control-Allow-Origin: *
X-Powered-By: Express
Content-Security-Policy: default-src 'none'
X-Content-Type-Options: nosniff
Content-Type: text/html; charset=utf-8
Content-Length: 149
Date: Mon, 16 Oct 2023 15:06:58 GMT
Connection: keep-alive
Keep-Alive: timeout=5

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<pre>Cannot GET /ws/example</pre>
</html> is the server address

No record in syslog. Guessing what is wrong?

You are trying to connect to a websocket using curl, while you need a websocket client in order to connect.
It is possible with curl to perform a websocket request, but it is a bit more complicated than this.

Yes, you are correct.
That helped

wscat -c "ws://"
Connected (press CTRL+C to quit)
> Hello
< Hello

You can, of course, just use a separate flow with a ws in node! :wink:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.