Archived

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

Ice for Javascript: IceStorm Subscriber

Can you clarify whether it is possible to implement an IceStorm Subscriber client using Ice for Javascript?

Comments

  • mes
    mes California
    It's possible if you use Glacier2 as a front-end for IceStorm.

    Ice for JavaScript currently does not provide full server-side support, so callbacks such as IceStorm publishing events can only be received over a bidirectional connection, but IceStorm does not support bidirectional subscribers. However, if you use Glacier2 as a front end, a JavaScript client can establish a bidirectional connection with Glacier2 and Glacier2 will forward callbacks back to the JavaScript client.

    Regards,
    Mark
  • I notice that you do provide a Javascript implemenation of the IceStorm interface. If you can't subscribe to a topic with a Javascript client, what can you do with Javascript IceStorm.
    mes wrote: »
    It's possible if you use Glacier2 as a front-end for IceStorm.

    Ice for JavaScript currently does not provide full server-side support, so callbacks such as IceStorm publishing events can only be received over a bidirectional connection, but IceStorm does not support bidirectional subscribers. However, if you use Glacier2 as a front end, a JavaScript client can establish a bidirectional connection with Glacier2 and Glacier2 will forward callbacks back to the JavaScript client.

    Regards,
    Mark
  • mes
    mes California
    Hi Dennis,

    A Javascript subscriber would need to connect via Glacier2. The Glacier2 router will set up the bidirectional connection to the subscriber and forward events from IceStorm.

    Regards,
    Mark
  • We are not currently using Glacier2, so I will need to investigate how to set that up. I'm just trying to port some C++ Ice client code that uses IceStorm directly.

    Thanks.
  • benoit
    benoit Rennes, France
    edited April 2016
    Hi,

    Beware that if you provide access to your IceStorm service directly to JavaScript clients, you must make sure the JavaScript clients run in a trusted environment (this isn't actually specific to JavaScript). Otherwise, a JavaScript client could easily destroy topics...

    If they aren't running in a trusted environment, a typical way to provide access to IceStorm to the untrusted clients is to use Glacier2 and sessions. The client only interacts with a session object (which acts as "facade") through Glacier2 and this session object interacts with IceStorm on behalf of the client.

    See the deployment of our chat demo for an example on this: https://doc.zeroc.com/display/Doc/Chat+Demo

    Cheers,
    Benoit.
  • Thanks. I will check that it out. That is probably the perfect example for me to follow.