INNER CODE UNIT · TypeScript

onError

homarr-labs/homarr · apps/websocket/src/main.ts:25

  const onError = (error: Error) => {
    wss.off("listening", onListening);
    reject(error);
  };

  wss.once("listening", onListening);
  wss.once("error", onError);
});

const handler = applyWSSHandler({
  wss,
  router: appRouter,
  // ignore error on next line because the createContext must be set with this name
  // eslint-disable-next-line no-restricted-syntax
  createContext: async ({ req }) => {
    try {
      const headers = Object.entries(req.headers).map(
        ([key, value]) => [key, typeof value === "string" ? value : value?.[0]] as [string, string],

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…