mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-11 01:11:18 +02:00
Update websockets.md
This commit is contained in:
parent
017d73ec3e
commit
9a1b689917
@ -9,7 +9,7 @@ nav_order: 2
|
|||||||
Websockets
|
Websockets
|
||||||
=================
|
=================
|
||||||
|
|
||||||
`websockets` are a great way to add a two way instant data channel between server and client. This example was taken from teh copilot extension, we create a websocket endpoint which can be restricted by `id`, then can feed it data to broadcast to any client on the socket using the `updater(extension_id, data)` function (`extension` has been used in place of an extension name, wreplace to your own extension):
|
`websockets` are a great way to add a two way instant data channel between server and client. This example was taken from the `copilot` extension, we create a websocket endpoint which can be restricted by `id`, then can feed it data to broadcast to any client on the socket using the `updater(extension_id, data)` function (`extension` has been used in place of an extension name, wreplace to your own extension):
|
||||||
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@ -84,4 +84,4 @@ initWs: async function () {
|
|||||||
console.log(res)
|
console.log(res)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user