mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-17 13:30:00 -04:00
Add dynamic, finishing basic proxy functionality
This commit is contained in:
parent
6d99559768
commit
db2b7a6c2f
13 changed files with 203 additions and 12 deletions
|
@ -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]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue