MCPcopy Index your code
hub / github.com/filebrowser/filebrowser / command

Function command

frontend/src/api/commands.ts:7–20  ·  view source on GitHub ↗
(
  url: string,
  command: string,
  onmessage: WebSocket["onmessage"],
  onclose: WebSocket["onclose"]
)

Source from the content-addressed store, hash-verified

5const protocol = ssl ? "wss:" : "ws:";
6
7export default function command(
8 url: string,
9 command: string,
10 onmessage: WebSocket["onmessage"],
11 onclose: WebSocket["onclose"]
12) {
13 url = removePrefix(url);
14 url = `${protocol}//${window.location.host}${baseURL}/api/command${url}`;
15
16 const conn = new window.WebSocket(url);
17 conn.onopen = () => conn.send(command);
18 conn.onmessage = onmessage;
19 conn.onclose = onclose;
20}

Callers

nothing calls this directly

Calls 1

removePrefixFunction · 0.90

Tested by

no test coverage detected