From 5c0ce2159b1e641fc999411f4a252d9811ee6735 Mon Sep 17 00:00:00 2001 From: Yifei0727 Date: Fri, 21 Jun 2019 01:30:34 +0800 Subject: [PATCH] add jsonignore for param localHost --- shadowsocks-csharp/Controller/Service/PACServer.cs | 2 +- shadowsocks-csharp/Controller/Service/UpdateChecker.cs | 2 +- shadowsocks-csharp/Model/Configuration.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shadowsocks-csharp/Controller/Service/PACServer.cs b/shadowsocks-csharp/Controller/Service/PACServer.cs index b53648fc..f1ee3218 100644 --- a/shadowsocks-csharp/Controller/Service/PACServer.cs +++ b/shadowsocks-csharp/Controller/Service/PACServer.cs @@ -51,7 +51,7 @@ namespace Shadowsocks.Controller PacSecret = ""; } - PacUrl = $"http://{config.LocalHost}:{config.localPort}/pac?t={GetTimestamp(DateTime.Now)}{PacSecret}"; + PacUrl = $"http://{config.localHost}:{config.localPort}/pac?t={GetTimestamp(DateTime.Now)}{PacSecret}"; } diff --git a/shadowsocks-csharp/Controller/Service/UpdateChecker.cs b/shadowsocks-csharp/Controller/Service/UpdateChecker.cs index 1e94c571..6cf562a3 100644 --- a/shadowsocks-csharp/Controller/Service/UpdateChecker.cs +++ b/shadowsocks-csharp/Controller/Service/UpdateChecker.cs @@ -170,7 +170,7 @@ namespace Shadowsocks.Controller { WebClient http = new WebClient(); http.Headers.Add("User-Agent", UserAgent); - http.Proxy = new WebProxy(config.LocalHost, config.localPort); + http.Proxy = new WebProxy(config.localHost, config.localPort); return http; } diff --git a/shadowsocks-csharp/Model/Configuration.cs b/shadowsocks-csharp/Model/Configuration.cs index 08f88fbb..b7e62325 100644 --- a/shadowsocks-csharp/Model/Configuration.cs +++ b/shadowsocks-csharp/Model/Configuration.cs @@ -36,8 +36,8 @@ namespace Shadowsocks.Model public HotkeyConfig hotkey; private static string CONFIG_FILE = "gui-config.json"; - - public string LocalHost => GetLocalHost(); + [JsonIgnore] + public string localHost => GetLocalHost(); private string GetLocalHost() { return isIPv6Enabled ? "[::1]" : "127.0.0.1"; }