Home Help Center

Ice for Javascript: IceStorm Subscriber

pjtaitpjtait Member Philip TaitOrganization: Subaru TelescopeProject: Fibre-Fed Multi-ObjectSpectrograph;HyperSuprimeCam ✭✭
Can you clarify whether it is possible to implement an IceStorm Subscriber client using Ice for Javascript?

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    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
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    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.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    Thanks. I will check that it out. That is probably the perfect example for me to follow.
Sign In or Register to comment.