GUI-STUDIO commited on
Commit
f49b2e6
·
1 Parent(s): 19ec157

Update test.ts

Browse files
Files changed (1) hide show
  1. src/sub-router/test.ts +37 -9
src/sub-router/test.ts CHANGED
@@ -1,4 +1,6 @@
1
  import { Context, Elysia, t } from "elysia";
 
 
2
 
3
  const sub_router = new Elysia({ prefix: "/test" }).get("/foo", async (ctx) => {
4
  const { query, params, request, status } = ctx;
@@ -6,17 +8,43 @@ const sub_router = new Elysia({ prefix: "/test" }).get("/foo", async (ctx) => {
6
  const REQ0 = request.url;
7
  const REQ_ORIGIN = (ctx as any).publicOrigin || new URL(REQ0).origin;
8
 
9
- const res = await fetch(
10
- "https://dl.gemlelispe.workers.dev/https%3A%2F%2Fbcdnxw.hakunaymatata.com%2Fbt%2F7e1c2ff4f2a619c16f40825883eebe6e.mp4%3Fsign%3D288c2a2346ad3cd3c22dcc70e483ca7f%26t%3D1773678165?n=Vini%20Jr.%20(2025)",
11
- {
 
 
 
 
 
 
 
 
 
 
 
12
  headers: {
13
- host: "dl.gemlelispe.workers.dev",
14
- origin: "dl.gemlelispe.workers.dev",
15
- referer: "https://dl.vidsrc.vip/"
 
16
  },
17
- referrerPolicy: "no-referrer"
18
- }
19
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  const res_status = res.status;
22
  const res_headers = res.headers;
 
1
  import { Context, Elysia, t } from "elysia";
2
+ import { lookup } from "node:dns/promises";
3
+ import https from "node:https";
4
 
5
  const sub_router = new Elysia({ prefix: "/test" }).get("/foo", async (ctx) => {
6
  const { query, params, request, status } = ctx;
 
8
  const REQ0 = request.url;
9
  const REQ_ORIGIN = (ctx as any).publicOrigin || new URL(REQ0).origin;
10
 
11
+ let target = new URL(
12
+ "https://dl.gemlelispe.workers.dev/https%3A%2F%2Fbcdnxw.hakunaymatata.com%2Fbt%2F7e1c2ff4f2a619c16f40825883eebe6e.mp4%3Fsign%3D288c2a2346ad3cd3c22dcc70e483ca7f%26t%3D1773678165?n=Vini%20Jr.%20(2025)"
13
+ );
14
+
15
+ try {
16
+ const { address: ip } = await lookup(target.hostname);
17
+
18
+ const options = {
19
+ hostname: ip,
20
+ port: 443,
21
+ path: "/",
22
+ method: "GET",
23
+ // CRITICAL: Tells the server which SSL certificate to use (SNI)
24
+ servername: target.hostname,
25
  headers: {
26
+ // CRITICAL: Tells the web server which site you want
27
+ Host: target.hostname,
28
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
29
+ Accept: "*/*"
30
  },
31
+ // Optional: helpful if the target has specific timeout issues
32
+ timeout: 5000
33
+ };
34
+
35
+ console.log({ options });
36
+ } catch (error: any) {
37
+ console.log(error);
38
+ }
39
+
40
+ const res = await fetch(target.href, {
41
+ headers: {
42
+ host: "dl.gemlelispe.workers.dev",
43
+ origin: "dl.gemlelispe.workers.dev",
44
+ referer: "https://dl.vidsrc.vip/"
45
+ },
46
+ referrerPolicy: "no-referrer"
47
+ });
48
 
49
  const res_status = res.status;
50
  const res_headers = res.headers;