MCPcopy
hub / github.com/ChromeDevTools/chrome-devtools-mcp / randomPort

Method randomPort

tests/server.ts:20–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 #server: Server;
19
20 static randomPort() {
21 /**
22 * Some ports are restricted by Chromium and will fail to connect
23 * to prevent we start after the
24 *
25 * https://source.chromium.org/chromium/chromium/src/+/main:net/base/port_util.cc;l=107?q=kRestrictedPorts&ss=chromium
26 */
27 const min = 10101;
28 const max = 20202;
29 return Math.floor(Math.random() * (max - min + 1) + min);
30 }
31
32 #routes: Record<string, (req: IncomingMessage, res: ServerResponse) => void> =
33 {};

Callers 2

mainFunction · 0.80
serverHooksFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected