修改文件Controller-Service-PACserver.cssocket
一、code
//PacUrl = $"http://127.0.0.1:{config.localPort}/pac?t={GetTimestamp(DateTime.Now)}{PacSecret}"; PacUrl = $"http://127.0.0.1:{config.localPort}/pac";
二、server
foreach (string line in lines) { string[] kv = line.Split(new char[] { ':' }, 2); if (kv.Length == 2) { if (kv[0] == "Host") { if (kv[1].Trim() == ((IPEndPoint)socket.LocalEndPoint).ToString()) { hostMatch = true; } } //else if (kv[0] == "User-Agent") //{ // // we need to drop connections when changing servers // if (kv[1].IndexOf("Chrome") >= 0) // { // useSocks = true; // } //} } //匹配驗證,直接將pathMatch和secretMatch置爲true //else if (kv.Length == 1) //{ // if (line.IndexOf("pac", StringComparison.Ordinal) >= 0) // { // pathMatch = true; // } // if (!secretMatch) // { // if(line.IndexOf(PacSecret, StringComparison.Ordinal) >= 0) // { // secretMatch = true; // } // } //} } pathMatch = true; secretMatch = true;