# Can I use the websocket interface in parallel with Navigator to demonstrate notifications?

**URL:** <https://forum.canton.network/t/can-i-use-the-websocket-interface-in-parallel-with-navigator-to-demonstrate-notifications/904>\
**Category:** App Development\
**Created:** [July 23, 2020, 11:58am UTC](https://forum.canton.network/t/can-i-use-the-websocket-interface-in-parallel-with-navigator-to-demonstrate-notifications/904 "2020-07-23T11:58:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [July 23, 2020, 11:58am UTC](https://forum.canton.network/t/can-i-use-the-websocket-interface-in-parallel-with-navigator-to-demonstrate-notifications/904/1 "2020-07-23T11:58:32Z")

</div>

If yes, could you point me to a suitable websocket client?

I want to demonstrate that I submit data with Navigator, and as soon as some condition gets fulfilled, a new contract gets created, and that we can get a notification from the creation of the new contract without polling the REST API.

Thanks

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [July 23, 2020, 12:24pm UTC](https://forum.canton.network/t/can-i-use-the-websocket-interface-in-parallel-with-navigator-to-demonstrate-notifications/904/2 "2020-07-23T12:24:19Z")

</div>

Absolutely, there isn’t anything special about the websocket interface or the JSON API in general. We don’t have a generic websocket client but what you could do is to use `create-daml-app` and attach navigator to it as well. If you then create the changes in navigator, you will see them propagate to the UI immediately via the websocket API. If you already have an existing app, it might be a useful starting point

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [July 23, 2020, 12:26pm UTC](https://forum.canton.network/t/can-i-use-the-websocket-interface-in-parallel-with-navigator-to-demonstrate-notifications/904/3 "2020-07-23T12:26:09Z")

</div>

To start Navigator as part of the `daml start` command in the `create-daml-app` template, you can just change the last line of the generated `daml.yaml` from

```yaml
start-navigator: false

```

to

```yaml
start-navigator: true

```

---

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [July 23, 2020, 12:34pm UTC](https://forum.canton.network/t/can-i-use-the-websocket-interface-in-parallel-with-navigator-to-demonstrate-notifications/904/4 "2020-07-23T12:34:25Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![Luciano](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/luciano/32/319_2.png) [@Luciano](https://forum.canton.network/u/Luciano)\
**Post date:** [July 30, 2020, 9:45am UTC](https://forum.canton.network/t/can-i-use-the-websocket-interface-in-parallel-with-navigator-to-demonstrate-notifications/904/5 "2020-07-30T09:45:08Z")

</div>

You should in principle be able to use a general websocket client too. Some googling around shows [this](https://stackoverflow.com/questions/47860689/how-to-read-websocket-response-in-linux-shell) question on Stackoverflow, that links to [this](https://gist.github.com/htp/fbce19069187ec1cc486b594104f01d0) example of how to use CURL to read a websocket, in general.

Of course, you will need to make sure you start up the HTTP-JSON service, which provides the websocket endpoint. This is the same interface that the `create-daml-app` connects to.

And finally a disclaimer: I haven’t tried this myself.
