diff options
Diffstat (limited to 'portal/test')
-rw-r--r-- | portal/test/js/websockets_hello.ml | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/portal/test/js/websockets_hello.ml b/portal/test/js/websockets_hello.ml index 76b70e4..1e8b364 100644 --- a/portal/test/js/websockets_hello.ml +++ b/portal/test/js/websockets_hello.ml @@ -17,15 +17,9 @@ let rec run t = let () = run @@ - let* ws = Portal_ws.ws_endpoint "squarebowl.club" in - let stream, push = - Portal_ws.ws_stream ws in - push (Some "malformed"); - let+ stanzas = stream - |> Lwt_stream.map - (fun stanza -> - match stanza with - | {|<close xmlns='urn:ietf:params:xml:ns:xmpp-framing'/>|} -> push None; stanza - | stanza -> stanza) - |> Lwt_stream.to_list - in List.map (fun x -> " >>> " ^ x) stanzas |> String.concat "\n" |> print_endline + let domain = "squarebowl.club" in + let* stream, push = + Portal_ws.connect domain in + push (Some {|<malformed/>|}); + let+ _ = Lwt_stream.iter (fun f -> print_endline f) stream + in push None |