FEAT: ADD RAMMER(HELL)HEAD

This commit is contained in:
rift 2023-12-20 21:26:58 -06:00
parent af18beb134
commit 4f13c42b6e
4 changed files with 202 additions and 4 deletions

View file

@ -1,7 +1,28 @@
export function ProxyFrame(props: { id: string }) {
import { RammerheadEncode } from "./RammerheadEncode";
import { useEffect, useState } from "preact/hooks";
export function ProxyFrame(props: { url: string }) { // pass the URL encoded with encodeURIcomponent
var localProxy = localStorage.getItem("proxy") || "automatic";
var [ProxiedUrl, setProxiedUrl] = useState<string | undefined>(undefined);
var decodedUrl = decodeURIComponent(props.url);
useEffect(() => {
if (localProxy === "rammerhead") {
RammerheadEncode(decodedUrl).then((result: string) => {
console.log("ProxyHref inside:", result);
setProxiedUrl(result);
});
}
}, [localProxy]);
console.log(ProxiedUrl);
return (
<div>
<h1>{props.id}</h1>
<h1 className="text-black">{props.url}</h1>
<h1 className="text-black">{localProxy}</h1>
<h1 className="text-black">{ProxiedUrl}</h1>
</div>
);
); // @TODO: Routing (iframe, ab, direct, etc.)
}