WebSocket server

Hi,

My intention is to streaam real-time data to my web UI integrated with the CtrlX Core dashboard. I have an UDP server implemented in Node.js to collect data from external sensor, and web-server cloned from the go.hello sample.

I have a Node.js WebSocket server implemented in the same snap application with the UDP server. It's working on my own computer w/o snap. The problem is that I'm unable to allow access to the WebSocket server, even if I know how to enable access to the UDP server. From the log file I can see that the WebSocket server is running, but not accessible. Propably something wrong with my config files.

I wonder if there's any example available how to implement WebSocket server, so that I could compare my configurations.

Best reply by japikas

It's very useful to ask questions here. First I struggle for days, and after asking I manage to figure out the problem within an hour... ðŸ˜Š

As usual, the problem was in own code. I did some changes after testing on own computer, which caused it not to work properly. Now it's working and case closed.

What my App does? Collects data from UDP socket server and USB serial port simultaneously. Synchronizes the data and provides as live-stream over WebSocket. A different snap app implements web server to host a web page to render the data in real-time chart.

View original
8 replies