(http_origin: &str, path: &str)
| 2020 | } |
| 2021 | |
| 2022 | fn websocket_url(http_origin: &str, path: &str) -> String { |
| 2023 | if http_origin.starts_with("https://") { |
| 2024 | format!( |
| 2025 | "wss://{}{}", |
| 2026 | http_origin.trim_start_matches("https://"), |
| 2027 | path |
| 2028 | ) |
| 2029 | } else if http_origin.starts_with("http://") { |
| 2030 | format!("ws://{}{}", http_origin.trim_start_matches("http://"), path) |
| 2031 | } else { |
| 2032 | path.to_owned() |
| 2033 | } |
| 2034 | } |
| 2035 | |
| 2036 | #[allow(dead_code)] |
| 2037 | fn timestamp_ms() -> f64 { |
no outgoing calls
no test coverage detected