Client app sample.

This commit is contained in:
ravinsp
2022-08-21 19:36:29 +05:30
parent 7e2ec90542
commit b2996fbcea
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
const HotPocket = require('hotpocket-js-client');
async function clientApp() {
const userKeyPair = await HotPocket.generateKeys();
const client = await HotPocket.createClient(['wss://localhost:8081'], userKeyPair);
// Establish HotPocket connection.
if (!await client.connect()) {
console.log('Connection failed.');
return;
}
console.log('HotPocket Connected.');
}
clientApp();

View File

@@ -0,0 +1,6 @@
{
"name": "_projname_",
"dependencies": {
"hotpocket-js-client": "0.5.3"
}
}