diff options
| author | polwex <polwex@sortug.com> | 2025-10-06 07:58:25 +0700 |
|---|---|---|
| committer | polwex <polwex@sortug.com> | 2025-10-06 07:58:25 +0700 |
| commit | 410cc8e8949c6ab0677daebbad10cea5f1b9686c (patch) | |
| tree | 2946ca36a81d5642fb8cd53a2268ecca0e89b59e /app/lib/websockets.hoon | |
| parent | c4b392a179048f936c062f5ffccc2bc25627e500 (diff) | |
added websockets server logic to nostrill
Diffstat (limited to 'app/lib/websockets.hoon')
| -rw-r--r-- | app/lib/websockets.hoon | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/lib/websockets.hoon b/app/lib/websockets.hoon new file mode 100644 index 0000000..9faea96 --- /dev/null +++ b/app/lib/websockets.hoon @@ -0,0 +1,14 @@ +|% + ++ give-ws-payload + |= [wid=@ event=websocket-event:eyre] + ^- (list card:agent:gall) + =/ =cage + [%websocket-response !>([wid event])] + =/ wsid (scot %ud wid) + :~ [%give %fact ~[/websocket-server/[wsid]] cage] + == + ++ accept-handshake |= wid=@ + =/ response [%accept ~] + (give-ws-payload wid response) + +-- |
