MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / websocket_url

Function websocket_url

packages/server/src/webkit.rs:1166–1178  ·  view source on GitHub ↗
(http_origin: &str, path: &str)

Source from the content-addressed store, hash-verified

1164}
1165
1166fn websocket_url(http_origin: &str, path: &str) -> String {
1167 if http_origin.starts_with("https://") {
1168 format!(
1169 "wss://{}{}",
1170 http_origin.trim_start_matches("https://"),
1171 path
1172 )
1173 } else if http_origin.starts_with("http://") {
1174 format!("ws://{}{}", http_origin.trim_start_matches("http://"), path)
1175 } else {
1176 path.to_owned()
1177 }
1178}
1179
1180fn encode_target_id(app_id: &str, page_id: u64) -> String {
1181 format!("{}-{page_id}", hex::encode(app_id.as_bytes()))

Callers 1

webkit_targetFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected