use wss instead of ws when not on localhost

This commit is contained in:
pena 2023-01-10 05:07:07 +01:00 committed by Swrup
parent 1f632f65cb
commit 498d187d76

View file

@ -11,7 +11,8 @@ let ws =
~some:(fun port -> Format.sprintf ":%d" port)
(Uri.port location)
in
Jstr.of_string @@ Format.sprintf "ws://%s%s/island/ws" host port
let ws = if host = "localhost" then "ws" else "wss" in
Jstr.of_string @@ Format.sprintf "%s://%s%s/island/ws" ws host port
in
Websocket.create ws_url