Archived
This forum has been archived. Please start a new discussion on GitHub.
Ice for Javascript: IceStorm Subscriber
pjtait
in Help Center
Can you clarify whether it is possible to implement an IceStorm Subscriber client using Ice for Javascript?
0
Comments
-
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,
Mark0 -
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,
Mark0 -
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.0
