AdvancedForwarding: updated code to implement new FWD record proxy type changes.

This commit is contained in:
Shreyas Zare
2023-09-23 18:03:31 +05:30
parent 5d955a6303
commit 2d480d7306

View File

@@ -29,7 +29,6 @@ using TechnitiumLibrary;
using TechnitiumLibrary.Net;
using TechnitiumLibrary.Net.Dns;
using TechnitiumLibrary.Net.Dns.ResourceRecords;
using TechnitiumLibrary.Net.Proxy;
namespace AdvancedForwarding
{
@@ -82,7 +81,7 @@ namespace AdvancedForwarding
DnsForwarderRecordData forwarderRecord;
if (configProxyServer is null)
forwarderRecord = new DnsForwarderRecordData(protocol, forwarder, dnssecValidation, NetProxyType.None, null, 0, null, null);
forwarderRecord = new DnsForwarderRecordData(protocol, forwarder, dnssecValidation, DnsForwarderRecordProxyType.DefaultProxy, null, 0, null, null);
else
forwarderRecord = new DnsForwarderRecordData(protocol, forwarder, dnssecValidation, configProxyServer.Type, configProxyServer.ProxyAddress, configProxyServer.ProxyPort, configProxyServer.ProxyUsername, configProxyServer.ProxyPassword);
@@ -769,7 +768,7 @@ namespace AdvancedForwarding
#region variables
readonly string _name;
readonly NetProxyType _type;
readonly DnsForwarderRecordProxyType _type;
readonly string _proxyAddress;
readonly ushort _proxyPort;
readonly string _proxyUsername;
@@ -782,7 +781,7 @@ namespace AdvancedForwarding
public ConfigProxyServer(JsonElement jsonProxy)
{
_name = jsonProxy.GetProperty("name").GetString();
_type = jsonProxy.GetPropertyEnumValue("type", NetProxyType.Http);
_type = jsonProxy.GetPropertyEnumValue("type", DnsForwarderRecordProxyType.Http);
_proxyAddress = jsonProxy.GetProperty("proxyAddress").GetString();
_proxyPort = jsonProxy.GetProperty("proxyPort").GetUInt16();
_proxyUsername = jsonProxy.GetPropertyValue("proxyUsername", null);
@@ -796,7 +795,7 @@ namespace AdvancedForwarding
public string Name
{ get { return _name; } }
public NetProxyType Type
public DnsForwarderRecordProxyType Type
{ get { return _type; } }
public string ProxyAddress