mirror of
https://github.com/netchx/netch.git
synced 2026-03-18 18:13:21 +08:00
Update ACL to "data"
This commit is contained in:
@@ -445,7 +445,7 @@ namespace Netch.Forms
|
||||
if (useProxy)
|
||||
req.Proxy = new WebProxy($"http://127.0.0.1:{Global.Settings.HTTPLocalPort}");
|
||||
|
||||
await WebUtil.DownloadFileAsync(req, Path.Combine(Global.NetchDir, "bin\\default.acl"));
|
||||
await WebUtil.DownloadFileAsync(req, Path.Combine(Global.NetchDir, Global.UserACL));
|
||||
NotifyTip(i18N.Translate("ACL updated successfully"));
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
using Netch.Controllers;
|
||||
using Netch.Forms;
|
||||
using Netch.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -10,6 +7,9 @@ using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using WindowsJobAPI;
|
||||
using Netch.Controllers;
|
||||
using Netch.Forms;
|
||||
using Netch.Models;
|
||||
|
||||
namespace Netch
|
||||
{
|
||||
@@ -39,6 +39,9 @@ namespace Netch
|
||||
private static bool? _supportFakeDns;
|
||||
}
|
||||
|
||||
public const string UserACL = "data\\user.acl";
|
||||
public const string BuiltinACL = "bin\\default.acl";
|
||||
|
||||
/// <summary>
|
||||
/// 出口适配器
|
||||
/// </summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Netch.Controllers;
|
||||
@@ -58,12 +59,14 @@ namespace Netch.Servers.Shadowsocks
|
||||
$"-l {this.Socks5LocalPort()} " +
|
||||
$"-m {server.EncryptMethod} " +
|
||||
$"-k \"{server.Password}\" " +
|
||||
"-u ");
|
||||
"-u");
|
||||
if (!string.IsNullOrWhiteSpace(server.Plugin) && !string.IsNullOrWhiteSpace(server.PluginOption))
|
||||
argument.Append($"--plugin {server.Plugin} " +
|
||||
$"--plugin-opts \"{server.PluginOption}\"");
|
||||
argument.Append($" --plugin {server.Plugin}" +
|
||||
$" --plugin-opts \"{server.PluginOption}\"");
|
||||
if (mode.BypassChina)
|
||||
argument.Append(" --acl default.acl");
|
||||
{
|
||||
argument.Append($" --acl {Path.GetFullPath(File.Exists(Global.UserACL) ? Global.UserACL : Global.BuiltinACL)}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Netch.Controllers;
|
||||
using Netch.Models;
|
||||
@@ -34,7 +35,8 @@ namespace Netch.Servers.ShadowsocksR
|
||||
}
|
||||
|
||||
argument.Append($" -b {this.LocalAddress()} -l {this.Socks5LocalPort()} -u");
|
||||
if (mode.BypassChina) argument.Append(" --acl default.acl");
|
||||
if (mode.BypassChina)
|
||||
argument.Append($" --acl {Path.GetFullPath(File.Exists(Global.UserACL) ? Global.UserACL : Global.BuiltinACL)}");
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user