Use host-relative WebSocket URLs when launching new debugger

Summary:
Changelog: [Internal]

Uses the capability introduced in https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/4 to avoid repeating the dev server's host:port in the `ws` / `wss` parameter we pass to the Chrome DevTools frontend. This gives us more flexibility to handle port forwarding and redirects outside of `dev-middleware`. This is mostly useful in Meta's internal VS Code remoting setup, but this particular change should work equally well in open source.

Reviewed By: huntie

Differential Revision: D54107316

fbshipit-source-id: 68d4dbf4849ca431274bfb0dc8a4e05981bdd5b5
This commit is contained in:
Moti Zilberman
2024-02-26 05:33:18 -08:00
committed by Facebook GitHub Bot
parent 0f3018d6af
commit 451fffbb59
3 changed files with 96 additions and 46 deletions
@@ -132,8 +132,8 @@ export default function openDebuggerMiddleware({
Location: getDevToolsFrontendUrl(
experiments,
target.webSocketDebuggerUrl,
// Use a relative URL.
'',
serverBaseUrl,
{relative: true},
),
});
res.end();