aboutsummaryrefslogtreecommitdiff
path: root/portal/lib/portal_ws.ml
diff options
context:
space:
mode:
Diffstat (limited to 'portal/lib/portal_ws.ml')
-rw-r--r--portal/lib/portal_ws.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/portal/lib/portal_ws.ml b/portal/lib/portal_ws.ml
index fbdced7..9aeb1d4 100644
--- a/portal/lib/portal_ws.ml
+++ b/portal/lib/portal_ws.ml
@@ -15,6 +15,14 @@ let ws_endpoint (domain : string) =
Lastly, if [domain] doesn't provide a well-formed Web-host Metadata file, the function throws an exception. *)
let+ host_meta = Js_of_ocaml_lwt.XmlHttpRequest.perform_raw_url (well_known_of domain)
+ in let open Markup in
+ string host_meta.content
+ |> parse_xml
+ |> signals
+ |> write_xml
+ |> to_string
+
+(*
in let i = Xmlm.make_input (`String (0, host_meta.content))
(* This ugly function extracts the href element from a Link tag's attributes if it's a websocket. *)
and link_websocket = function
@@ -34,6 +42,7 @@ let ws_endpoint (domain : string) =
match parse_xrd i with
| Some uri -> uri
| None -> failwith (domain ^ "doesn't advertise a WebSocket endpoint via Web-host Metadata.")
+ *)
let ws_stream (url : string) =
(** [ws_stream url] returns an Lwt stream (and its push function) communicating with the websocket located at [url]