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

Function metro_devtools_frontend_url

packages/server/src/devtools.rs:769–783  ·  view source on GitHub ↗
(port: u16, entry: &Value, web_socket_debugger_url: &str)

Source from the content-addressed store, hash-verified

767}
768
769fn metro_devtools_frontend_url(port: u16, entry: &Value, web_socket_debugger_url: &str) -> String {
770 let frontend = string_value(entry, "devtoolsFrontendUrl");
771 let asset_path = metro_frontend_asset_path(frontend.as_deref());
772 let query = frontend
773 .as_deref()
774 .and_then(|value| split_path_query(value).1);
775 // Reverse-proxy Metro's own (version-matched) Fusebox frontend through the
776 // SimDeck origin so the LAN client and Studio app can reach it, with the
777 // socket rewritten to the proxied inspector path.
778 format!(
779 "{}?{}",
780 metro_frontend_proxy_base(port, &asset_path),
781 metro_frontend_query_with_socket(query, web_socket_debugger_url)
782 )
783}
784
785fn metro_frontend_proxy_base(port: u16, asset_path: &str) -> String {
786 format!("/api/metro/{port}{asset_path}")

Calls 3

split_path_queryFunction · 0.85
string_valueFunction · 0.70