MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / extractDomainFromArgs

Function extractDomainFromArgs

dig/dig.ts:54–66  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

52 return arg;
53 }
54 }
55 return null;
56}
57
58function isValidIPv4(ip: string): boolean {
59 const ipv4Regex =
60 /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
61 return ipv4Regex.test(ip);
62}
63
64async function getIpLocation(ip: string): Promise<string> {
65 try {
66 const response = await axios.get(`https://api.ip.sb/geoip/${ip}`, {
67 timeout: 3000,
68 headers: {
69 "User-Agent": "TeleBox-DNS-Plugin/1.0",

Callers 2

formatShortDnsResultsFunction · 0.85
formatDetailedDnsResultsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected