MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getWsUrl

Function getWsUrl

src/server/web/public/terminal.js:8822–8834  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8820 });
8821 window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
8822 term.options.theme = getTheme();
8823 });
8824}
8825function getWsUrl() {
8826 const proto = location.protocol === "https:" ? "wss:" : "ws:";
8827 const url = new URL(`${proto}//${location.host}/ws`);
8828 const params = new URLSearchParams(location.search);
8829 const token = params.get("token") ?? localStorage.getItem("claude-terminal-token");
8830 if (token) {
8831 url.searchParams.set("token", token);
8832 localStorage.setItem("claude-terminal-token", token);
8833 }
8834 url.searchParams.set("cols", String(term.cols));
8835 url.searchParams.set("rows", String(term.rows));
8836 return url.toString();
8837}

Callers 1

connectFunction · 0.70

Calls 3

getMethod · 0.65
toStringMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected