mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-17 13:30:00 -04:00
FEAT: ADD RAMMER(HELL)HEAD
This commit is contained in:
parent
af18beb134
commit
4f13c42b6e
4 changed files with 202 additions and 4 deletions
|
@ -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.)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue