diff options
-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 |