Using Cesium as external simulation viewer

I have a flight simulation project that consists of a Qt front end app that communicates with a JSBSim flight dynamics model over UDP. I'm searching for an OTW (out the window) viewer that I can also communicate with via UDP. I have a Cesium viewer running now, displayed by a Qt QWebView widget, and it looks nice, but I'm having trouble setting up the UDP connection.

Note: I'm brand new to javascript, so I'm trying to learn that as I go along. It seems my best bet is to use dgram.js, part of the node distribution, to receive the aircraft position/orientation data from the simulator and then move the viewer's camera accordingly.

My problem is that I can't get the require('dgram') line to work, which would indicate that the dgram module can't be found. I have node and npm installed, and am using the "nodejs server.js" command to run the server from within my cesium directory, which indicates that I have node successfully installed globally. From what I've read on the interwebz the last few days, I need the node modules installed locally in order for the require('dgram') to work.

Try as I might I can't figure out how/where to install node locally so that dgram can be found. I see that there is a node_modules directory in Cesium, but it doesn't contain dgram.js.

Any ideas?

Note(1): Linux, with Cesium installed at $HOME/cesium
Note(2): My project is QtJSBSim (hosted at sourceforge)

I've dropped the UDP socket idea. It turns out that Qt has the ability to share a C++ object with a web page's javascript environment, so that's how I get the aircraft position and orientation from the flight dynamics engine to the viewer.

Screenshot: https://dl.dropboxusercontent.com/u/12562954/JSBSim-Cesium.jpg

I have something coming up that will be very similar. I've tested several things using UDP and it DOES work. The issue you are more than likely running into (based on lack of info and you said you're new to javascript), nodejs is server side. The javascript to control Cesium is client side. You can't use node modules within your client side javascript. If you were to use something like Electron (http://electron.atom.io) you could using the remote module. If you want a little more info on this, I'd be happy to share