Ice for JavaScript runtime
You can install Ice for JavaScript with either npm
or bower
.
$ npm install zeroc-icejs --save
This module also includes the browser version of Ice for JavaScript.
$ bower install zeroc-icejs --save
var Ice = require('zeroc-icejs').Ice;
var Glacier2 = require('zeroc-icejs').Glacier2;
var IceStorm = require('zeroc-icejs').IceStorm;
var IceGrid = require('zeroc-icejs').IceGrid;
var communicator = Ice.initialize(process.argv);
var proxy = communicator.stringToProxy("hello:tcp -h localhost -p 10000");
The npm package also includes the browser version of Ice for JavaScript. Refer to the bower
documentation below, replacing bower_components
with node_modules
.
Add the necessary <script>
tags to your html to include the Ice for JavaScript components you require.
<script src="/bower_components/zeroc-icejs/lib/Ice.js"></script>
<script src="/bower_components/zeroc-icejs/lib/Glacier2.js"></script>
<script src="/bower_components/zeroc-icejs/lib/IceStorm.js"></script>
<script src="/bower_components/zeroc-icejs/lib/IceGrid.js"></script>
<script type="text/javascript">
var communicator = Ice.initialize();
var proxy = communicator.stringToProxy("hello:ws -h localhost -p 10002");
</script>
Minified versions are available with the .min.js
extension.
See the Ice Documentation.
To compile Slice files to JavaScript see the following:
A collection of demos for Ice for JavaScript can be found here.