# Websocket issue on project: DABL

**URL:** <https://forum.canton.network/t/websocket-issue-on-project-dabl/908>\
**Category:** App Development\
**Created:** [July 23, 2020, 3:18pm UTC](https://forum.canton.network/t/websocket-issue-on-project-dabl/908 "2020-07-23T15:18:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartcant](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bartcant/32/823_2.png) [@bartcant](https://forum.canton.network/u/bartcant)\
**Post date:** [July 23, 2020, 3:18pm UTC](https://forum.canton.network/t/websocket-issue-on-project-dabl/908/1 "2020-07-23T15:18:52Z")

</div>

Hi. I am experimenting with Project dable

I deployed my app to  
`nxhgy6yk92nxerri`

But I am receiving a websocket fail upon retrieving some of my data

This is what is displayed in my dev console

> index.js:478 WebSocket connection to ‘wss://api.projectdabl.com/data/nxhgy6yk92nxerri/v1/stream/query’ failed: Error during WebSocket handshake: Unexpected response code: 403 e.streamSubmit @ index.js:478 e.streamQuery @ index.js:586 (anonymous) @ createLedgerContext.js:170 is @ react-dom.production.min.js:211 mu @ react-dom.production.min.js:257 t.unstable\_runWithPriority @ scheduler.production.min.js:19 Ui @ react-dom.production.min.js:122 bu @ react-dom.production.min.js:257 (anonymous) @ react-dom.production.min.js:256 z @ scheduler.production.min.js:17 S.port1.onmessage @ scheduler.production.min.js:14 react\_devtools\_backend.js:2273 useStreamQuery: web socket closed {code: 1006, reason: “”}

---

<div class="post-metadata">

**Author:** ![Li\_Ma](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/li_ma/32/305_2.png) [@Li\_Ma](https://forum.canton.network/u/Li_Ma)\
**Post date:** [July 23, 2020, 4:08pm UTC](https://forum.canton.network/t/websocket-issue-on-project-dabl/908/2 "2020-07-23T16:08:09Z")

</div>

Hi @bartcant

From the error message: `Error during WebSocket handshake: Unexpected response code: 403` you provided

It’s highly possible that the token you supplied in the WebSocket subprotocol is invalid or expired. Note there are two subprotocols you need to supply, `jwt.token.{YOUR_LEDGER_PARTY_TOKEN}` and `daml.ws.auth`.

The “Live Data” view on Project:DABL also use WebSocket connection to show the data, if you can see the data there, it’s very likely your app is using an invalid token.

You can fetch fresh ledger party tokens at Ledger Settings =\> Party JWT.

Let me know does new token solves it and happy to help more on this. See more details about authentication on DABL here: [https://docs.projectdabl.com/api/#authentication](https://docs.projectdabl.com/api/#authentication)

---

<div class="post-metadata">

**Author:** ![bartcant](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bartcant/32/823_2.png) [@bartcant](https://forum.canton.network/u/bartcant)\
**Post date:** [July 23, 2020, 4:10pm UTC](https://forum.canton.network/t/websocket-issue-on-project-dabl/908/3 "2020-07-23T16:10:12Z")

</div>

Thanks for the insights…

I noticed in my code, it is still using the same bearer token in the Network communication as my local environment, but the ledger id is now different `nxhgy6yk92nxerri`  
I will regenerate the token and try again

---

<div class="post-metadata">

**Author:** ![Li\_Ma](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/li_ma/32/305_2.png) [@Li\_Ma](https://forum.canton.network/u/Li_Ma)\
**Post date:** [July 23, 2020, 4:14pm UTC](https://forum.canton.network/t/websocket-issue-on-project-dabl/908/4 "2020-07-23T16:14:35Z")

</div>

Yes very likely @bartcant

The party token expires in 24 hours by default. For this specific use case check out “service-account” at [https://docs.projectdabl.com/api/#authentication](https://docs.projectdabl.com/api/#authentication) whcih provides a long-lived credential for token exchange.
