diff options
author | FxQnLr <[email protected]> | 2024-06-17 11:19:13 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-06-17 11:19:13 +0200 |
commit | b375657e660b199127a76683980a5d210a572ab7 (patch) | |
tree | fbed775283917537c1d2d11bdbf38a0fa7c05a02 /src/requests/start.rs | |
parent | 31a57425a76cae121c5d8ef5b0f2442ca6a9ee61 (diff) | |
parent | 0877850a63791772dd19a0af9a0c7c87940aead2 (diff) | |
download | webol-cli-b375657e660b199127a76683980a5d210a572ab7.tar webol-cli-b375657e660b199127a76683980a5d210a572ab7.tar.gz webol-cli-b375657e660b199127a76683980a5d210a572ab7.zip |
0.3.0
Diffstat (limited to 'src/requests/start.rs')
-rw-r--r-- | src/requests/start.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/requests/start.rs b/src/requests/start.rs index 3afbe3a..1ec3ce8 100644 --- a/src/requests/start.rs +++ b/src/requests/start.rs | |||
@@ -17,12 +17,12 @@ pub async fn start(config: &Config, id: String, ping: bool) -> Result<(), Error> | |||
17 | let send_start = MultiProgress::new(); | 17 | let send_start = MultiProgress::new(); |
18 | let overview = add_pb(&send_start, OVERVIEW_STYLE, format!(") start {id}")); | 18 | let overview = add_pb(&send_start, OVERVIEW_STYLE, format!(") start {id}")); |
19 | 19 | ||
20 | let url = format_url(config, "start", &Protocols::Http); | 20 | let url = format_url(config, "start", &Protocols::Http, Some(&id)); |
21 | let connect = add_pb(&send_start, DEFAULT_STYLE, format!("connect to {url}")); | 21 | let connect = add_pb(&send_start, DEFAULT_STYLE, format!("connect to {url}")); |
22 | let res = reqwest::Client::new() | 22 | let res = reqwest::Client::new() |
23 | .post(url) | 23 | .post(url) |
24 | .headers(default_headers(config)?) | 24 | .headers(default_headers(config)?) |
25 | .body(format!(r#"{{"id": "{id}", "ping": {ping}}}"#)) | 25 | .body(format!(r#"{{"ping": {ping}}}"#)) |
26 | .send() | 26 | .send() |
27 | .await?; | 27 | .await?; |
28 | finish_pb(&connect, "connected, got response".to_string(), DONE_STYLE); | 28 | finish_pb(&connect, "connected, got response".to_string(), DONE_STYLE); |
@@ -71,8 +71,8 @@ async fn status_socket( | |||
71 | let ws_pb = add_pb(pb, DEFAULT_STYLE, "connect to websocket".to_string()); | 71 | let ws_pb = add_pb(pb, DEFAULT_STYLE, "connect to websocket".to_string()); |
72 | 72 | ||
73 | let request = Request::builder() | 73 | let request = Request::builder() |
74 | .uri(format_url(config, "status", &Protocols::Websocket)) | 74 | .uri(format_url(config, "status", &Protocols::Websocket, None)) |
75 | .header("Authorization", &config.apikey) | 75 | .header("Authorization", &config.auth.secret) |
76 | .header("sec-websocket-key", "") | 76 | .header("sec-websocket-key", "") |
77 | .header("host", &config.server) | 77 | .header("host", &config.server) |
78 | .header("upgrade", "websocket") | 78 | .header("upgrade", "websocket") |