diff --git a/src/ws_client.ml b/src/ws_client.ml index f34b86a..05179c8 100644 --- a/src/ws_client.ml +++ b/src/ws_client.ml @@ -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