function proxyImageUrl
proxyImageUrl(
url: string,
): string

Returns url routed through GET /api/remote/image, or unchanged when it needs no proxy. Only an HTTP URL is proxied by default, so that an HTTPS page doesn't block it as mixed content. A relative or localhost URL is never proxied.

Parameters

url: string
optional
opts: ProxyImageOptions

Return Type

string

Usage

import { proxyImageUrl } from "src/utils/shared/proxyImage.ts";