Archived
How to run IceJS-0.1.0-demos in Tomcat or Apache?
Comments
-
Hi,
First you need to build the demos, as documented here Sample Programs - Ice for JavaScript 0.1 - ZeroC
After you have build the demos you need to edit the endpoints to match your deployment.
For the hello demo client endpoints are defined in demojs/Ice/hello/browser/Client.js in this file change the linevar proxy = communicator.stringToProxy("hello" + ":ws -h " + hostname + " -p 8080 -r /demows" + ":wss -h " + hostname + " -p 9090 -r /demowss");
By this new configurationvar proxy = communicator.stringToProxy("hello" + ":ws -h " + hostname + " -p 10002" + ":wss -h " + hostname + " -p 10003");
Now copy the demos to your Apache document root or a web server directory of your choice.cd /var/www cp -rf ~/IceJS-0.1.0-demos js
You also need to copy the Ice for JavaScript libraries to the same directory in your webservercd /var/www mkdir lib cp /opt/IceJS-0.1.0/lib/*.js lib/
Now open a web browser and point it to the demo page http://127.0.0.1/js/index.html
For WSS (secure endpoints) to work , you need to access the demos using HTTPS and configure the web browsers to trust the demos certificate.
Similar changes to client endpoints are required for other demos, that is because the NodeJS web server provided in the demo distribution uses a reverse proxy, clients are configured to connect to the reverse proxy and not to the Ice server, so that web sockets and HTPP connections can share the port configurations and simplify SSL deployment.0 -
"Slice" undefined
hi, thanks for your reply!
According to your instruction, I deploy demos in Tomcat 7.0.56, and open it in IE 11
http://127.0.0.1:8080/js/demojs/Ice/hello/index.html
but no "Hello world" in server.exe, debug in IE F12, in Hello.js show
"Slice" undefined
Where did I go wrong?0 -
Hi,
I have the impression that Ice.js library was not loaded, With your configuration Ice.js should be available at http://127.0.0.1:8080/js/lib/Ice.js0 -
Have Icestorm Demo for Ice javascript
Thanks xdm!
It's my wrong.
In addition, there is Icestorm demo for Ice javascript?0 -
Currently we don't have an IceStorm demo for Ice for JavaScript0
-
I followed all the above directions. I found I had to mv the assets directory tree up one level to document root to eliminate most of the errors. I'm left with this:
Loading failed for the with source “http://localhost/js/{{.}}”. index.html:114:1
ReferenceError: $ is not defined
common.js:8:1The error is on this line of js/index.html
Clues welcome.
0 -
Hi Philip,
This instructions are for and old version, you better follow 3.7 instructions in https://github.com/zeroc-ice/ice-demos/tree/3.7/js, the HTML files use a JavaScript template that is not being expand in this case. You should run them with the included JavaScript server as mentioned in the 3.7 demos README
0 -
Just to clarify: The current version of the demos cannot be run with an Apache server, correct? But it is still possible to write a browser-based IceJS client to work with Apache, without requiring Node.js?
0 -
Success, thanks for the help!
1 -
Yes current demos cannot run on Apache because we use a JavaScript template system for the HTML, but you can use Ice for JavaScript with any web server.
Glad you get things to work.
0