diff --git a/src/components/embed-types/common.tsx b/src/components/embed-types/common.tsx
index 7482c592f..173ebea9d 100644
--- a/src/components/embed-types/common.tsx
+++ b/src/components/embed-types/common.tsx
@@ -18,7 +18,8 @@ export function embedImages(content: EmbedableContent, trusted = false) {
/https?:\/\/([\dA-z\.-]+\.[A-z\.]{2,6})((?:\/[\+~%\/\.\w\-_]*)?\.(?:svg|gif|png|jpg|jpeg|webp|avif))(\??(?:[\?#\-\+=&;%@\.\w_]*)#?(?:[\-\.\!\/\\\w]*))?/i,
render: (match) => {
const ImageComponent = trusted || !appSettings.value.blurImages ? Image : BlurredImage;
- return ;
+ const src = appSettings.value.imageProxy ? `${appSettings.value.imageProxy}${match[0]}` : match[0];
+ return ;
},
name: "Image",
});
diff --git a/src/services/user-app-settings.ts b/src/services/user-app-settings.ts
index 688b2eac4..bd6f769b4 100644
--- a/src/services/user-app-settings.ts
+++ b/src/services/user-app-settings.ts
@@ -25,6 +25,7 @@ export type AppSettings = {
lightningPayMode: LightningPayMode;
zapAmounts: number[];
primaryColor: string;
+ imageProxy: string;
};
export const defaultSettings: AppSettings = {
@@ -37,6 +38,7 @@ export const defaultSettings: AppSettings = {
lightningPayMode: LightningPayMode.Prompt,
zapAmounts: [50, 200, 500, 1000],
primaryColor: "#8DB600",
+ imageProxy: "",
};
function parseAppSettings(event: NostrEvent): AppSettings {
diff --git a/src/views/settings/performance-settings.tsx b/src/views/settings/performance-settings.tsx
index 20c918fd7..3f6c4dd0f 100644
--- a/src/views/settings/performance-settings.tsx
+++ b/src/views/settings/performance-settings.tsx
@@ -9,13 +9,20 @@ import {
Box,
AccordionIcon,
FormHelperText,
+ Input,
+ Link,
} from "@chakra-ui/react";
import appSettings, { replaceSettings } from "../../services/app-settings";
import useSubject from "../../hooks/use-subject";
import useAppSettings from "../../hooks/use-app-settings";
+import { useEffect, useState } from "react";
export default function PerformanceSettings() {
- const { autoShowMedia, proxyUserMedia, showReactions, showSignatureVerification, updateSettings } = useAppSettings();
+ const { autoShowMedia, proxyUserMedia, showReactions, showSignatureVerification, updateSettings, imageProxy } =
+ useAppSettings();
+
+ const [proxyInput, setProxyInput] = useState(imageProxy);
+ useEffect(() => setProxyInput(imageProxy), [imageProxy]);
return (
@@ -46,6 +53,34 @@ export default function PerformanceSettings() {
Side Effect: Some user pictures may not load or may be outdated
+
+
+ Image proxy service
+
+ setProxyInput(e.target.value)}
+ onBlur={() => {
+ try {
+ const url = proxyInput ? new URL(proxyInput).toString() : "";
+ if (url !== imageProxy) {
+ updateSettings({ imageProxy: url });
+ setProxyInput(url);
+ }
+ } catch (e) {}
+ }}
+ />
+
+
+ A URL to an instance of{" "}
+
+ willnorris/imageproxy
+
+
+
+