Websocket on different port?

Hi,
I have a websocket server running on port 60000.

Using the built websocket node, how to set it up to connect to this port?
Is it possible?

I tried wss://127.0.0.1:60000 but it just disconnected.

I have confirmed my localhost websocket server is working/running by going to browser console and typing ws = new WebSocket("wss://127.0.0.1:60000") and it works.

Thanks.

That will connect to a websocket on the same device as the browser. Is node-red also running on that same device?

Yes.
Nodered also runs on 127.0.0.1:1880

same device.

Have you tried ws:// instead of wss://? Otherwise it will connect using transport encryption (SSL/TLS).

Yes I have. Still not working. Tried also ws://localhost:60000. still not work

I think you will need to restart node-red with the logging turned up to see if you can spot what is happening. Otherwise, you will need to start putting some extra log statements into the websocket node to see what is going on.

Finally got it to connect. Turns out my websocket needs a wss (secure). And reason it did not connect was that I did not add the TLS settings to it. Even with no certificates, the TLS needs to be added anyhow.

Anyway thanks for your replies guys

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