MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / websocket_url

Function websocket_url

packages/server/src/devtools.rs:2022–2034  ·  view source on GitHub ↗
(http_origin: &str, path: &str)

Source from the content-addressed store, hash-verified

2020}
2021
2022fn 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)]
2037fn timestamp_ms() -> f64 {

Callers 3

build_targetFunction · 0.70
build_metro_targetFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected