diff options
author | Clombrong <cromblong@egregore.fun> | 2025-08-17 16:35:52 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-08-17 16:48:22 +0200 |
commit | 8d5c6c404122070f1a69f1d886f4729fdcf7e6dd (patch) | |
tree | 633400507a26ab79aca9295d178b1440bf0200a4 /portal/ws | |
parent | 22b7dcd4fae032630e4041c5d6bdda88bad1e8b9 (diff) |
refactor(portal-ws): change socket type to the lwt stream
Diffstat (limited to 'portal/ws')
-rw-r--r-- | portal/ws/portal.ml | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/portal/ws/portal.ml b/portal/ws/portal.ml index 8d490cc..06c9c6f 100644 --- a/portal/ws/portal.ml +++ b/portal/ws/portal.ml @@ -5,11 +5,20 @@ open Markup let jss = Js.string let sjs = Js.to_string -type socket = WebSockets.webSocket Js.t - (** Opaque domain name type. Currently a string. *) type domain = string +(** [socket] is a framed Lwt stream (and its push function) communicating with a + websocket. + + Valid XMPP WebSocket subprotocol frames must be sent to the stream, because it + directly exposes the websocket under. *) +type socket = { + domain : domain; + stream : string Lwt_stream.t; + push : string option -> unit; + } + let domain_of_string (s : string) : domain = s let domain_to_string (s : domain) : string = s |