import { isIP } from "node:net"; import { type OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; import { makeProxyFetch } from "openclaw/plugin-sdk/infra-runtime"; import { danger } from "openclaw/plugin-sdk/runtime-env"; import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env"; import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime"; import type { ResolvedDiscordAccount } from "./accounts.js";
export function validateDiscordProxyUrl(proxyUrl: string): string {
let parsed: URL; try {
parsed = new URL(proxyUrl);
} catch { thrownew Error("Proxy URL must be a valid http or https URL");
} if (!["http:", "https:"].includes(parsed.protocol)) { thrownew Error("Proxy URL must use http or https");
} if (!isLoopbackProxyHostname(parsed.hostname)) { thrownew Error("Proxy URL must target a loopback host");
} return proxyUrl;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.