-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.mjs
31 lines (30 loc) · 969 Bytes
/
index.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* IP 地址查询接口
* 无 CORS
*/
// https://ip2location.deno.dev?ip=101.67.50.27
Deno.serve((req) => {
const fd = new FormData();
fd.set("ip", new URL(req.url).searchParams.get("ip"));
return fetch("https://iplocation.com/", {
headers: {
accept: "*/*",
"accept-language":
"zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
priority: "u=1, i",
"sec-ch-ua":
'"Microsoft Edge";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Windows"',
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
},
referrer: "https://iplocation.com/",
referrerPolicy: "strict-origin-when-cross-origin",
body: fd,
method: "POST",
mode: "cors",
credentials: "include",
});
});