DNS settings check

This commit is contained in:
2dust 2021-12-19 20:47:19 +08:00
parent 610a610ee0
commit 716029def8

View file

@ -181,6 +181,21 @@ namespace v2rayN.Forms
UI.Show(UIRes.I18N("PleaseSelectProtocol")); UI.Show(UIRes.I18N("PleaseSelectProtocol"));
return -1; return -1;
} }
var remoteDNS = txtremoteDNS.Text.TrimEx();
var obj = Utils.ParseJson(remoteDNS);
if (obj != null && obj.ContainsKey("servers"))
{
}
else
{
if (remoteDNS.Contains("{") || remoteDNS.Contains("}"))
{
UI.Show(UIRes.I18N("FillCorrectDNSText"));
return -1;
}
}
config.inbound[0].localPort = Utils.ToInt(localPort); config.inbound[0].localPort = Utils.ToInt(localPort);
config.inbound[0].protocol = protocol; config.inbound[0].protocol = protocol;
config.inbound[0].udpEnabled = udpEnabled; config.inbound[0].udpEnabled = udpEnabled;
@ -227,7 +242,7 @@ namespace v2rayN.Forms
//Mux //Mux
config.muxEnabled = muxEnabled; config.muxEnabled = muxEnabled;
//remoteDNS //remoteDNS
config.remoteDNS = txtremoteDNS.Text.TrimEx(); config.remoteDNS = txtremoteDNS.Text.TrimEx();
config.defAllowInsecure = chkdefAllowInsecure.Checked; config.defAllowInsecure = chkdefAllowInsecure.Checked;