Add dynamic, finishing basic proxy functionality

This commit is contained in:
rift 2023-12-21 13:04:59 -06:00
parent 6d99559768
commit db2b7a6c2f
13 changed files with 203 additions and 12 deletions

View file

@ -4,6 +4,7 @@ import { useEffect, useState } from "preact/hooks";
declare global {
interface Window {
__uv$config: any;
__dynamic$config: any;
}
}
@ -31,6 +32,13 @@ export function ProxyFrame(props: { url: string }) {
} else if (localProxy === "ultraviolet") {
window.location.href =
window.__uv$config.prefix + window.__uv$config.encodeUrl(decodedUrl);
} else if (localProxy === "dynamic") {
window.location.href =
window.__dynamic$config.prefix + encodeURIComponent(decodedUrl);
} else {
// use UV for automatic
window.location.href =
window.__uv$config.prefix + window.__uv$config.encodeUrl(decodedUrl);
}
}, [localProxy]);