using System; using System.Collections.Generic; using System.Linq; namespace Netch.Models { /// /// TUN/TAP 适配器配置类 /// public class TUNTAPConfig { /// /// 地址 /// public string Address = "10.0.236.10"; /// /// 掩码 /// public string Netmask = "255.255.255.0"; /// /// 网关 /// public string Gateway = "10.0.236.1"; /// /// DNS /// public List DNS = new List(); /// /// 使用自定义 DNS 设置 /// public bool UseCustomDNS = false; /// /// 模式 2 下是否代理 DNS /// public bool ProxyDNS = false; /// /// 使用Fake DNS /// public bool UseFakeDNS = false; } public class KcpConfig { public int mtu = 1350; public int tti = 50; public int uplinkCapacity = 12; public int downlinkCapacity = 100; public bool congestion = false; public int readBufferSize = 2; public int writeBufferSize = 2; } public class V2rayConfig { public bool AllowInsecure = true; public KcpConfig KcpConfig = new KcpConfig(); public bool UseMux = true; } public class AioDNSConfig { public string RulePath = "bin\\china_site_list"; public string ChinaDNS = "223.5.5.5"; public string OtherDNS = "1.1.1.1"; public string Protocol = "tcp"; } /// /// 用于读取和写入的配置的类 /// public class Setting { /// /// 服务器选择位置 /// public int ServerComboBoxSelectedIndex = 0; /// /// 模式选择位置 /// public int ModeComboBoxSelectedIndex = 0; /// /// 是否关闭窗口时退出 /// public bool ExitWhenClosed = false; /// /// 是否退出时停止 /// public bool StopWhenExited = false; /// /// 是否打开软件时启动加速 /// public bool StartWhenOpened = false; /// /// 是否启动后自动最小化 /// public bool MinimizeWhenStarted = false; /// /// 是否开机启动软件 /// public bool RunAtStartup = false; /// /// 是否打开软件时检查更新 /// public bool CheckUpdateWhenOpened = true; /// /// 是否检查 Beta 更新 /// public bool CheckBetaUpdate = false; /// /// 是否打开软件时更新订阅 /// public bool UpdateSubscribeatWhenOpened = false; /// /// 修改系统 DNS /// public bool ModifySystemDNS = false; /// /// 要修改为的系统 DNS /// public string ModifiedDNS = "1.1.1.1,8.8.8.8"; /// /// 解析服务器主机名 /// public bool ResolveServerHostname = false; /// /// 网页请求超时 毫秒 /// public int RequestTimeout = 10000; /// /// PAC URL /// public string Pac_Url = ""; /// /// PAC端口 /// public int Pac_Port = 2803; /// /// HTTP 本地端口 /// public ushort HTTPLocalPort = 2802; /// /// Socks5 本地端口 /// public ushort Socks5LocalPort = 2801; /// /// Redirector TCP 占用端口 /// public ushort RedirectorTCPPort = 3901; /// /// UDP Socket 占用端口 /// public ushort UDPSocketPort = 18291; /// /// HTTP 和 Socks5 本地代理地址 /// public string LocalAddress = "127.0.0.1"; /// /// TUNTAP 适配器配置 /// public TUNTAPConfig TUNTAP = new TUNTAPConfig(); /// /// 使用代理更新订阅 /// public bool UseProxyToUpdateSubscription = false; /// /// 订阅链接列表 /// public List SubscribeLink = new List(); /// /// 服务器列表 /// public readonly List Server = new List(); /// /// 全局绕过 IP 列表 /// public List BypassIPs = new List(); /// /// 已保存的快捷配置 /// public List Profiles = new List(); /// /// 快捷配置数量 /// public int ProfileCount = 4; /// /// STUN测试服务器 /// public string STUN_Server = "stun.syncthing.net"; /// /// STUN测试服务器 /// public int STUN_Server_Port = 3478; /// /// 是否启用启动后延迟测试 /// public bool StartedTcping = false; /// /// 启动后延迟测试间隔/秒 /// public int StartedTcping_Interval = 3; /// /// ACL规则 /// public string ACL = "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/banAD.acl"; /// /// GFWList /// public string GFWLIST = "https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt"; /// /// 是否使用DLL启动Shadowsocks /// public bool BootShadowsocksFromDLL = true; /// /// 语言设置 /// public string Language = "System"; public V2rayConfig V2RayConfig = new V2rayConfig(); public AioDNSConfig AioDNS = new AioDNSConfig(); public bool RedirectorSS = false; public bool ProcessNoProxyForUdp = false; } }