Skip to content

Commit

Permalink
Remove Resolve Server Hostname setting
Browse files Browse the repository at this point in the history
  • Loading branch information
chsbuffer committed Sep 20, 2021
1 parent 04d6933 commit 68d87e2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 27 deletions.
19 changes: 3 additions & 16 deletions Netch/Forms/SettingForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Netch/Forms/SettingForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ public SettingForm()
c => Global.Settings.LocalAddress = AllowDevicesCheckBox.Checked ? "0.0.0.0" : "127.0.0.1",
Global.Settings.LocalAddress switch { "127.0.0.1" => false, "0.0.0.0" => true, _ => false });

BindCheckBox(ResolveServerHostnameCheckBox, c => Global.Settings.ResolveServerHostname = c, Global.Settings.ResolveServerHostname);

BindRadioBox(ICMPingRadioBtn, _ => { }, !Global.Settings.ServerTCPing);

BindRadioBox(TCPingRadioBtn, c => Global.Settings.ServerTCPing = c, Global.Settings.ServerTCPing);
Expand Down
3 changes: 2 additions & 1 deletion Netch/Models/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public static class ServerExtension
{
public static async Task<string> AutoResolveHostnameAsync(this Server server, AddressFamily inet = AddressFamily.Unspecified)
{
return Global.Settings.ResolveServerHostname ? (await DnsUtils.LookupAsync(server.Hostname, inet))!.ToString() : server.Hostname;
// ! MainController cached
return (await DnsUtils.LookupAsync(server.Hostname, inet))!.ToString();
}

public static bool IsInGroup(this Server server)
Expand Down
5 changes: 0 additions & 5 deletions Netch/Models/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,6 @@ public class Setting
/// </summary>
public int RequestTimeout { get; set; } = 10000;

/// <summary>
/// 解析服务器主机名
/// </summary>
public bool ResolveServerHostname { get; set; } = true;

/// <summary>
/// 是否开机启动软件
/// </summary>
Expand Down
3 changes: 1 addition & 2 deletions Netch/Resources/zh-CN
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"Please select a mode first": "请先选择一个模式",
"Please enter a profile name first": "请先为该配置设置一个名称",
"No saved profile here. Save a profile first by Ctrl+Click on the button": "当前按钮下没有保存配置,请先使用 CTRL + 左键 点击该按钮保存一个配置",
"Lookup Server hostname failed": "解析服务器主机名失败",

"Used": "已使用",
"Testing": "测试中",
Expand Down Expand Up @@ -154,14 +155,12 @@
"Handle process's DNS Hijack": "被代理进程 DNS 劫持",
"Child Process Handle": "子进程代理",
"ICMP Delay(ms)": "ICMP 延迟(毫秒)",
"Redirector built-in Shadowsocks support": "Redirector 内建 Shadowsocks 支持",
"Profile Count": "快捷配置数量",
"Delay test after start(sec)": "启动后延迟测试(秒)",
"Ping Protocol": "延迟测试协议",
"Detection Tick(sec)": "检测心跳(秒)",
"STUN Server": "STUN 服务器",
"Language": "语言",
"Resolve Server Hostname": "解析服务器主机名",
"FullCone Support (Required Server Xray-core v1.3.0+)": "FullCone 支持(需服务端 Xray-core v1.3.0+)",
"Disable Support Warning": "停用支持警告",

Expand Down
2 changes: 1 addition & 1 deletion Netch/Servers/Trojan/TrojanController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task<Socks5LocalServer> StartAsync(Server s)
},
ssl = new TrojanSSL
{
sni = server.Host.ValueOrDefault() ?? (Global.Settings.ResolveServerHostname ? server.Hostname : "")
sni = server.Host.ValueOrDefault() ?? server.Hostname
}
};

Expand Down

0 comments on commit 68d87e2

Please sign in to comment.