*Check if resolved dns is an ip or domain, return false otherwise

This commit is contained in:
Derrick Hammer 2022-08-01 00:28:07 -04:00
parent 3cef7a78d9
commit 7b59584c57
1 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,10 @@ export default class ServerProvider extends BaseProvider {
async handleProxy(details: OnRequestDetailsType): Promise<any> {
const dns = await this.resolveDns(details);
return { type: "http", host: dns, port: 80 };
if (isIp(dns) || isDomain(dns)) {
return { type: "http", host: dns, port: 80 };
}
return false;
}
}