blob: 32f312262abc3b19b67d88ffd3b0ef63665ab23c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { isLocalApp } from "$lib/Utility/appOrigin";
export const proxy = (url: string, disable = false) => {
const randomKey = Math.floor(Math.random() * 90) + 10;
return isLocalApp() && !disable
? url
: `https://proxy.due.moe/?d2=${btoa(
url
.split("")
.map((char) => char.charCodeAt(0) + randomKey)
.join(":"),
)}${randomKey}&dh`;
};
export default proxy;
|