summaryrefslogtreecommitdiff
path: root/app/lib/websockets.hoon
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-11-01 03:55:13 +0700
committerpolwex <polwex@sortug.com>2025-11-01 03:55:13 +0700
commit7305d67ff7f9e78b73326ef0e1f68a9613d34205 (patch)
tree5e075673b42811a76963c956502ac2c5fc2ea8f4 /app/lib/websockets.hoon
parentf019da2e338733dd88d3a8efe60f260d74b9a7ad (diff)
ws connection to relay fixed, tested
Diffstat (limited to 'app/lib/websockets.hoon')
-rw-r--r--app/lib/websockets.hoon12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/lib/websockets.hoon b/app/lib/websockets.hoon
index 98ea25b..8e6d45c 100644
--- a/app/lib/websockets.hoon
+++ b/app/lib/websockets.hoon
@@ -6,6 +6,13 @@
[%message !>(msg)]
=/ wsid (scot %ud wid)
[%give %fact ~[/websocket-client/[wsid]] cage]
+ ++ close-ws-client
+ |= wid=@
+ ^- card:agent:gall
+ =/ =cage
+ [%disconnect !>(~)]
+ =/ wsid (scot %ud wid)
+ [%give %fact ~[/websocket-client/[wsid]] cage]
++ give-ws-payload-server
|= [wid=@ event=websocket-event:eyre]
@@ -26,6 +33,11 @@
(give-ws-payload-server wid response)
==
+ ++ get-url
+ |= [wid=@ud =bowl:gall] ^- @t
+ =/ scry-path=path /(scot %p our.bowl)/ws/(scot %da now.bowl)/id/(scot %ud wid)
+ =/ conn .^(websocket-connection:iris %ix scry-path)
+ url.conn
++ check-connected
|= [url=@t =bowl:gall] ^- (unit websocket-connection:iris)
=/ scry-path=path /(scot %p our.bowl)/ws/(scot %da now.bowl)/url/[url]