From bda43bf18fe42e60be61cab7ad5b177ec18b133e Mon Sep 17 00:00:00 2001 From: Simon Popugaev Date: Wed, 6 Sep 2023 14:58:08 +0300 Subject: [PATCH] ws vs wss --- src/clients/worker.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/clients/worker.rs b/src/clients/worker.rs index a6f94b4..1965e78 100644 --- a/src/clients/worker.rs +++ b/src/clients/worker.rs @@ -272,7 +272,10 @@ impl WorkerClient for WorkerC auth: &CloudAuthentication, ) -> Result<(), GolemError> { let mut url = self.base_url.clone(); - url.set_scheme("wss") + + let ws_schema = if url.scheme() == "http" { "ws" } else { "wss" }; + + url.set_scheme(ws_schema) .map_err(|_| GolemError("Can't set schema.".to_string()))?; url.path_segments_mut() .map_err(|_| GolemError("Can't get path.".to_string()))?