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:

Config:
image

State:
image

 curl -i http://192.168.8.158:1880/ws/example
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">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /ws/example</pre>
</body>
</html>

192.168.8.158 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://192.168.8.158:1880/ws/example"
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.