How do you run a proxy with node.js example?

I am attempting to run the node.js HelloWorld example as detailed in http://cesiumjs.org/2013/04/12/Cesium-up-and-running/ (which btw is awesome - what a simple way to run your own webserver without a lot of technical know how and fuse).

I am getting cross domain exceptions so I am trying to setup a proxy as defined in http://cesiumjs.org/2013/01/04/Cesium-Imagery-Layers-Tutorial/. The linked Proxy is a java application with no running instructions. How can I run the java application and the node application on the same port at the same time? Do you have a node.js proxy? Would it be possible to include the proxy in the provided server.js?

Thanks,

Nathan

I configure server.js like an attachment file.
And I add this code to my web page (like this example https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Apps/Sandcastle/gallery/Imagery%20Layers%20Manipulation.html):
addAdditionalLayerOption(
‘United States weather radar’,
new Cesium.WebMapServiceImageryProvider({
url : 'http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?’,
layers : ‘nexrad-n0r’,
credit : ‘Radar data courtesy Iowa Environmental Mesonet’,
parameters : {
transparent : ‘true’,
format : ‘image/png’
}

server.js (1.06 KB)

Could you please further explain “I configure server.js like an attachment file”. What does that mean

Thanks

Nathan

I have sent the server.js as an attachment file. You be able to open that and see the code.

Aritz

We have an open issue to add proxy support to server.js: https://github.com/AnalyticalGraphicsInc/cesium/issues/829

In the meantime, you can take a look at the Node server we wrote for last year’s NASA Space Apps Challenge:

https://github.com/AnalyticalGraphicsInc/EarthKAMExplorer/blob/master/server/server.js

This code has an explicit check for the particular hostname we were using. You can modify or remove that check.