Archived

This forum has been archived. Please start a new discussion on GitHub.

Javascript ICE client setup

Hello,

I am trying to create a small javascript/html based ICE client talking to a java server. I am facing some problems setting up the examples that are part of the installer. Could someone please help me figure out what am I missing here ? I went through the documentation but couldn't find much that would resolve my error.

Running Client.js independantly
Below are the steps which I followed to run these applications.
1. cd '...\ZeroC\Ice-3.6b-demos\js'
2. node build.js
3. cd '..ZeroC\Ice-3.6b-demos\js\Ice\minimal'
4. node Client.js

At this point, I get an error saying 'Error: Cannot find module 'icejs''. I tried to manually change the dependency by copying the Ice.js and adding the dependency with an absolute path.

Any idea how could I get it running ?

Running in the browser
By only updating my object adapter with endpoints on the server side to be 'ws -h localhost -p 10000' , I was able to ping the server from the browser. However, I was not able to understand when would I have to use Glacier2 server for communication. I am sorry if I am being naive.

Thanks in advance for help.

Cheers,
Murthy

Comments

  • xdm
    xdm La Coruña, Spain
    For the samples in 3.6b installers you need to set NODE_PATH, this will allow nodejs to find icejs module:
    set NODE_PATH=<Ice installation root directory>\node_modules;%NODE_PATH%
    

    For the upcoming 3.6.0 Ice for JavaScript will be released as a NPM module, and it will not be part of the installers.

    Glacier2 is not required with 3.6b, with the first lab release we only provide Web Sockets support for C++ and if you need to talk to a Java/C# server from a web socket client you need to use a C++ intermediary like Glacier2.
  • Hello,

    Thanks a lot for the help, it worked :)

    Cheers,
    Murthy
  • Hello Xdm,

    I had a few further queries on what you mentioned.

    1. With 3.6b we do not need Glacier2 for communication with a java/C++/C# servers from a web socket client
    2. But in the latest stable release (I assume 3.5) Glacier2 is currently required to communicate with Java/C# servers from a web socket client.

    Is my understanding as above right ? What exactly did you mean by first lab release ?

    When is the 3.6 production release planned ? I would be interested in ice for javascripts and its communication with different ICE servers via websockets.


    Thanks in advance for help.

    Cheers,
    Murthy
  • benoit
    benoit Rennes, France
    Hi Murthy,

    Correct, the WebSocket lab project based on Ice 3.5 only included a C++ implementation for the WebSocket transport and therefore required to go through the Glacier2 service for a JavaScript web socket client to communicate with Java/C# services. This lab project has been retired after the release of Ice 3.6b. Ice 3.6 is due to be released in few days.

    Cheers,
    Benoit.
  • Thank you Benoit :)