HomePhabricator

[chronik-client] Support ping / pong in browser environment

Description

[chronik-client] Support ping / pong in browser environment

Summary:
ws.ping() is not available in the browser WebSocket object. However, ws.send is.

Implement a browser ping by subscribing to the first existing subscription if the ws.ping() method is unavailable.

Test Plan:
In nodejs, install this version of chronik-client and connect to a websocket. Subscribe. Add console.log statements to confirm ws.ping() is being used.
Implement this version of chronik-client in cashtab and npm start. Ref D15050. Confirm the browser ping is working.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien, tobias_ruck

Differential Revision: https://reviews.bitcoinabc.org/D15052

Details

Provenance
bytesofmanAuthored on Dec 29 2023, 21:54
bytesofmanPushed on Jan 3 2024, 14:17
Reviewer
Restricted Project
Differential Revision
D15052: [chronik-client] Support ping / pong in browser environment
Parents
rABC5e41abec1353: [Cashtab] Add new validation function for parsing opreturn as a bip21 parameter
Branches
Unknown
Tags
Unknown