Compare commits

..
56 Commits
Author SHA1 Message Date
2dust b921dd3610 Update AssemblyInfo.cs 2019-09-18 13:37:25 +08:00
2dust 1526b2435a Update PACServerHandle.cs 2019-09-18 13:37:22 +08:00
2dust 486b0920af Update HttpWebServerB.cs 2019-09-18 13:37:20 +08:00
2dust 59a6e1862c Update HttpWebServer.cs 2019-09-18 13:37:16 +08:00
2dust 8ddddb66df Update HttpWebServerB.cs 2019-09-11 11:24:09 +08:00
2dust 55d540d556 Update HttpWebServer.cs 2019-09-11 11:24:07 +08:00
2dust a2cf1cef16 fix ui 2019-09-11 09:42:58 +08:00
2dust 01fdb08dd3 up tls 2019-09-11 09:23:33 +08:00
2dust a8f1a992c5 Update MainForm.cs 2019-09-02 11:08:19 +08:00
2dust 1bbc73f963 Update ListViewFlickerFree.cs 2019-09-02 11:08:15 +08:00
2dust 2676ce0357 up 2019-09-01 20:14:02 +08:00
2dust b22bb90d2d fix state 2019-08-30 16:24:43 +08:00
2dust d0ca8b2996 up grpc state 2019-08-30 10:22:28 +08:00
2dust 3154df1bde Update StatisticsHandler.cs 2019-08-29 17:30:44 +08:00
2dust 3cdff624ba Merge pull request #46 from CGQAQ/dev
try 放在循环内,有异常不会退出循环。捕获漏网之鱼(syste.memory.dll)
2019-08-28 13:14:06 +08:00
CGQAQ 3cd80a20bb try 放在循环内,有异常不会退出循环。有个漏网之鱼(syste.memory.dll) 2019-08-28 09:43:29 +08:00
2dust 8986a96100 Merge pull request #45 from CGQAQ/dev
只能先这样了
2019-08-28 08:05:49 +08:00
CGQAQ 612ad30660 。 2019-08-27 18:40:15 +08:00
CGQAQ bc6517626e 只能先这样了
grpc_csharp_ext.x86.dll 和 grpc_csharp_ext.x64dll 没办法引用,所有只能放到output目录里了
2019-08-27 18:29:41 +08:00
2dust 99e9425942 Merge pull request #44 from CGQAQ/dev
统计切换为grpc
2019-08-27 15:58:21 +08:00
CGQAQ d555081820 统计切换为grpc 2019-08-27 15:51:15 +08:00
2dust a3f42e1e25 Merge pull request #43 from CGQAQ/dev
去重加入host
2019-08-27 13:06:58 +08:00
CGQAQ 52b31fba1e delete useless code due to remove auto reboot 2019-08-27 12:17:58 +08:00
CGQAQ 328c0be6e9 Update Utils.cs 2019-08-27 12:16:18 +08:00
CGQAQ 65d2db55f8 Merge remote-tracking branch 'upstream/master' into dev 2019-08-27 12:10:28 +08:00
2dust 54bebd9a6b up speed 2019-08-27 09:02:20 +08:00
2dust dcd050eee1 Update v2rayN.csproj 2019-08-26 17:32:17 +08:00
2dust 7d5dcc307e up 2019-08-26 17:31:19 +08:00
CGQAQ 7459ada9c0 去重加入host
现在判定两个server是不是一样的要看address port path 和 host
2019-08-26 17:20:49 +08:00
2dust f9c3003cc9 Merge pull request #40 from CGQAQ/master
一些修改
2019-08-26 16:26:09 +08:00
CGQAQ c1354600c7 一些修改
1. 需要重启的设置保存会自动重启
2. 去重逻辑更新 address port path
3. 一些重构和小修改
2019-08-26 16:21:08 +08:00
2dust 86b45d18af Merge pull request #39 from CGQAQ/master
修复v2rayN有几率无法退出问题
2019-08-26 13:41:38 +08:00
CGQAQ 26c9cd4d27 Update StatisticsHandler.cs
如果调用kill的时候进程已经退出,就会导致v2rayN程序无法退出,先判断该进程是否已经退出再kill,修复该问题
2019-08-26 13:37:52 +08:00
2dust 1be22a1a2c Merge pull request #36 from CGQAQ/master
【新功能】实时网速显示和历史流量统计,测速快捷键
2019-08-26 13:06:41 +08:00
CGQAQ 83e7ad9360 fix infinite loop thread hang there causes v2rayN hang in the background
修复死循环线程导致v2rayN在用户点击退出仍挂在后台
2019-08-26 09:32:45 +08:00
CGQAQ fe015b0227 fix number may exceed 1024
修复网速可能超过1024的问题,比如1500 Byte 应该是 1.x KB
2019-08-25 23:30:00 +08:00
CGQAQ 2861bff5a0 Add one click deduplicate feature
添加一键删除重复服务器功能
2019-08-25 22:43:28 +08:00
CGQAQ f036f12925 Update Utils.cs 2019-08-25 10:07:51 +08:00
CGQAQ 56bb63a012 add Statistics(netspeed, traffic data amount) 2019-08-25 09:33:38 +08:00
CGQAQ f1e9737080 basically completed 2019-08-24 21:32:33 +08:00
CGQAQ 649f0af6ec add Hotkeys
添加测速快捷键
2019-08-23 18:07:25 +08:00
CGQAQ 025a4491ed Add ping and speedtest hotkeys
增加测速快捷键
2019-08-23 15:51:37 +08:00
CGQAQ 197d8f1ace Merge pull request #1 from 2dust/master
sync
2019-08-23 14:08:18 +08:00
2dust f51e651410 Update V2rayConfigHandler.cs 2019-08-23 13:27:05 +08:00
2dust a091616790 up trimex 2019-08-23 11:01:22 +08:00
2dust 150fa91ff3 Merge pull request #31 from CGQAQ/master
fix potential problems about not doing null checking
2019-08-23 10:14:43 +08:00
CGQAQ 33a25d8b49 fix potential problems about not doing null checking 2019-08-23 10:07:20 +08:00
2dust dd1a01556f up pac server 2019-08-21 16:35:01 +08:00
2dust 5a1e5707b8 unsetproxy 2019-08-21 16:34:46 +08:00
2dust 5ec275a7e0 add socks user 2019-08-21 16:34:22 +08:00
2dust d1644bb591 up ser 2019-08-20 13:15:31 +08:00
2dust 93ecd20719 Create issue_template.md 2019-08-13 17:14:55 +08:00
2dust ed0231e7f9 up 2019-08-01 10:21:20 +08:00
2dust cf6c20b12e up all 2019-07-30 11:53:58 +08:00
2dust ab37076adc up 2019-07-30 11:52:43 +08:00
2dust 7894dd93b4 Initial commit 2019-07-30 11:47:24 +08:00
55 changed files with 1793 additions and 2526 deletions
-130
View File
@@ -1,130 +0,0 @@
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace v2rayN.Base
{
public class HttpWebServerB
{
private TcpListener listener;
private int port;
private Func<string, string> _responderMethod;
public HttpWebServerB(int port, Func<string, string> method)
{
this.port = port;
this._responderMethod = method;
Thread thread = new Thread(StartListen);
thread.IsBackground = true;
thread.Start();
}
public void Stop()
{
if (listener != null)
{
listener.Stop();
listener = null;
}
}
private void StartListen()
{
listener = new TcpListener(IPAddress.Any, port);
listener.Start();
Utils.SaveLog("WebserverB running...");
while (true)
{
if (!listener.Pending())
{
Thread.Sleep(100);
continue;
}
TcpClient socket = listener.AcceptTcpClient();
Thread thread = new Thread(new ParameterizedThreadStart(ProcessThread));
thread.IsBackground = true;
thread.Start(socket);
Thread.Sleep(1);
}
}
private void ProcessThread(object obj)
{
try
{
var socket = obj as TcpClient;
var inputStream = new BufferedStream(socket.GetStream());
var outputStream = new StreamWriter(new BufferedStream(socket.GetStream()));
if (inputStream.CanRead)
{
var data = ReadStream(inputStream);
if (data.Contains("/pac/"))
{
if (_responderMethod != null)
{
var address = ((IPEndPoint)socket.Client.LocalEndPoint).Address.ToString();
Utils.SaveLog("WebserverB Request " + address);
string pac = _responderMethod(address);
if (inputStream.CanWrite)
{
WriteStream(outputStream, pac);
}
}
}
}
outputStream.BaseStream.Flush();
inputStream = null;
outputStream = null;
socket.Close();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private string ReadStream(Stream inputStream)
{
int nextchar;
string data = "";
while (true)
{
nextchar = inputStream.ReadByte();
if (nextchar == '\n')
{
break;
}
if (nextchar == '\r')
{
continue;
}
if (nextchar == -1)
{
Thread.Sleep(1);
continue;
};
data += Convert.ToChar(nextchar);
}
return data;
}
private void WriteStream(StreamWriter outputStream, string pac)
{
var content_type = "application/x-ns-proxy-autoconfig";
outputStream.WriteLine("HTTP/1.1 200 OK");
outputStream.WriteLine(String.Format("Content-Type:{0}", content_type));
outputStream.WriteLine("Connection: close");
outputStream.WriteLine("");
outputStream.WriteLine(pac);
outputStream.Flush();
}
}
}
-47
View File
@@ -1,47 +0,0 @@
using System;
using System.Net;
namespace v2rayN.Base
{
class WebClientEx : WebClient
{
public int Timeout
{
get; set;
}
public WebClientEx(int timeout = 3000)
{
Timeout = timeout;
}
protected override WebRequest GetWebRequest(Uri address)
{
HttpWebRequest request;
if (address.Scheme == "https")
{
ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) => { return true; };
request = (HttpWebRequest)base.GetWebRequest(address);
request.ProtocolVersion = HttpVersion.Version10;
}
else
{
request = (HttpWebRequest)base.GetWebRequest(address);
}
request.Timeout = Timeout;
request.ReadWriteTimeout = Timeout;
//request.AllowAutoRedirect = false;
//request.AllowWriteStreamBuffering = true;
request.ServicePoint.BindIPEndPointDelegate = (servicePoint, remoteEndPoint, retryCount) =>
{
if (remoteEndPoint.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
return new IPEndPoint(IPAddress.IPv6Any, 0);
else
return new IPEndPoint(IPAddress.Any, 0);
};
return request;
}
}
}
-1
View File
@@ -35,6 +35,5 @@ namespace v2rayN.Forms
Utils.SaveLog($"Loading custom icon failed: {e.Message}");
}
}
}
}
@@ -1,7 +1,7 @@
using System.Drawing;
using System.Windows.Forms;
namespace v2rayN.Base
namespace v2rayN.Forms
{
class ListViewFlickerFree : ListView
{
+19 -30
View File
@@ -31,7 +31,7 @@
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.lvServers = new v2rayN.Base.ListViewFlickerFree();
this.lvServers = new v2rayN.Forms.ListViewFlickerFree();
this.cmsLv = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuAddVmessServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddShadowsocksServer = new System.Windows.Forms.ToolStripMenuItem();
@@ -52,8 +52,6 @@
this.menuSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.menuPingServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuTcpingServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuRealPingServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuSpeedServer = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.menuExport2ClientConfig = new System.Windows.Forms.ToolStripMenuItem();
@@ -64,8 +62,8 @@
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components);
this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuSysAgentEnabled = new System.Windows.Forms.ToolStripMenuItem();
this.menuSysAgentMode = new System.Windows.Forms.ToolStripMenuItem();
this.menuNotEnabledHttp = new System.Windows.Forms.ToolStripMenuItem();
this.menuGlobal = new System.Windows.Forms.ToolStripMenuItem();
this.menuGlobalPAC = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeep = new System.Windows.Forms.ToolStripMenuItem();
@@ -76,6 +74,7 @@
this.menuCopyPACUrl = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.menuExit = new System.Windows.Forms.ToolStripMenuItem();
this.bgwPing = new System.ComponentModel.BackgroundWorker();
this.bgwScan = new System.ComponentModel.BackgroundWorker();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
@@ -159,7 +158,6 @@
this.lvServers.UseCompatibleStateImageBehavior = false;
this.lvServers.View = System.Windows.Forms.View.Details;
this.lvServers.SelectedIndexChanged += new System.EventHandler(this.lvServers_SelectedIndexChanged);
this.lvServers.Click += new System.EventHandler(this.lvServers_Click);
this.lvServers.DoubleClick += new System.EventHandler(this.lvServers_DoubleClick);
this.lvServers.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvServers_KeyDown);
//
@@ -186,8 +184,6 @@
this.menuSelectAll,
this.toolStripSeparator9,
this.menuPingServer,
this.menuTcpingServer,
this.menuRealPingServer,
this.menuSpeedServer,
this.toolStripSeparator6,
this.menuExport2ClientConfig,
@@ -309,18 +305,6 @@
resources.ApplyResources(this.menuPingServer, "menuPingServer");
this.menuPingServer.Click += new System.EventHandler(this.menuPingServer_Click);
//
// menuTcpingServer
//
this.menuTcpingServer.Name = "menuTcpingServer";
resources.ApplyResources(this.menuTcpingServer, "menuTcpingServer");
this.menuTcpingServer.Click += new System.EventHandler(this.menuTcpingServer_Click);
//
// menuRealPingServer
//
this.menuRealPingServer.Name = "menuRealPingServer";
resources.ApplyResources(this.menuRealPingServer, "menuRealPingServer");
this.menuRealPingServer.Click += new System.EventHandler(this.menuRealPingServer_Click);
//
// menuSpeedServer
//
this.menuSpeedServer.Name = "menuSpeedServer";
@@ -379,6 +363,7 @@
this.cmsMain.ImageScalingSize = new System.Drawing.Size(20, 20);
resources.ApplyResources(this.cmsMain, "cmsMain");
this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuSysAgentEnabled,
this.menuSysAgentMode,
this.menuServers,
this.menuAddServers2,
@@ -391,10 +376,15 @@
this.cmsMain.ShowCheckMargin = true;
this.cmsMain.ShowImageMargin = false;
//
// menuSysAgentEnabled
//
this.menuSysAgentEnabled.Name = "menuSysAgentEnabled";
resources.ApplyResources(this.menuSysAgentEnabled, "menuSysAgentEnabled");
this.menuSysAgentEnabled.Click += new System.EventHandler(this.menuSysAgentEnabled_Click);
//
// menuSysAgentMode
//
this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuNotEnabledHttp,
this.menuGlobal,
this.menuGlobalPAC,
this.menuKeep,
@@ -402,12 +392,6 @@
this.menuSysAgentMode.Name = "menuSysAgentMode";
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
//
// menuNotEnabledHttp
//
this.menuNotEnabledHttp.Name = "menuNotEnabledHttp";
resources.ApplyResources(this.menuNotEnabledHttp, "menuNotEnabledHttp");
this.menuNotEnabledHttp.Click += new System.EventHandler(this.menuNotEnabledHttp_Click);
//
// menuGlobal
//
this.menuGlobal.Name = "menuGlobal";
@@ -466,6 +450,12 @@
resources.ApplyResources(this.menuExit, "menuExit");
this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
//
// bgwPing
//
this.bgwPing.WorkerReportsProgress = true;
this.bgwPing.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgwPing_DoWork);
this.bgwPing.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgwPing_ProgressChanged);
//
// bgwScan
//
this.bgwScan.WorkerReportsProgress = true;
@@ -785,13 +775,14 @@
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtMsgBox;
private v2rayN.Base.ListViewFlickerFree lvServers;
private v2rayN.Forms.ListViewFlickerFree lvServers;
private System.Windows.Forms.NotifyIcon notifyMain;
private System.Windows.Forms.ContextMenuStrip cmsMain;
private System.Windows.Forms.ToolStripMenuItem menuExit;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ToolStripMenuItem menuServers;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.ComponentModel.BackgroundWorker bgwPing;
private System.Windows.Forms.ContextMenuStrip cmsLv;
private System.Windows.Forms.ToolStripMenuItem menuAddVmessServer;
private System.Windows.Forms.ToolStripMenuItem menuRemoveServer;
@@ -819,6 +810,7 @@
private System.Windows.Forms.ToolStripMenuItem menuGlobal;
private System.Windows.Forms.ToolStripMenuItem menuGlobalPAC;
private System.Windows.Forms.ToolStripMenuItem menuKeep;
private System.Windows.Forms.ToolStripMenuItem menuSysAgentEnabled;
private System.Windows.Forms.ToolStripMenuItem menuCopyPACUrl;
private System.Windows.Forms.ToolStripMenuItem menuAddCustomServer;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
@@ -866,9 +858,6 @@
private System.Windows.Forms.ToolStripStatusLabel toolSslServerSpeed;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank4;
private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer;
private System.Windows.Forms.ToolStripMenuItem menuTcpingServer;
private System.Windows.Forms.ToolStripMenuItem menuRealPingServer;
private System.Windows.Forms.ToolStripMenuItem menuNotEnabledHttp;
}
}
+350 -191
View File
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Text;
@@ -8,7 +7,6 @@ using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.HttpProxyHandler;
using v2rayN.Mode;
using v2rayN.Base;
namespace v2rayN.Forms
{
@@ -16,7 +14,8 @@ namespace v2rayN.Forms
{
private V2rayHandler v2rayHandler;
private PACListHandle pacListHandle;
private DownloadHandle downloadHandle;
private V2rayUpdateHandle v2rayUpdateHandle;
private V2rayUpdateHandle v2rayUpdateHandle2;
private List<int> lvSelecteds = new List<int>();
private StatisticsHandler statistics = null;
@@ -33,14 +32,6 @@ namespace v2rayN.Forms
Application.ApplicationExit += (sender, args) =>
{
Utils.ClearTempPath();
v2rayHandler.V2rayStop();
HttpProxyHandle.CloseHttpAgent(config);
PACServerHandle.Stop();
ConfigHandler.SaveConfig(ref config);
statistics?.SaveToFile();
statistics?.Close();
};
}
@@ -50,13 +41,64 @@ namespace v2rayN.Forms
ConfigHandler.LoadConfig(ref config);
v2rayHandler = new V2rayHandler();
v2rayHandler.ProcessEvent += v2rayHandler_ProcessEvent;
if (config.enableStatistics)
{
statistics = new StatisticsHandler(config, UpdateStatisticsHandler);
}
}
private void UpdateStatisticsHandler(ulong totalUp, ulong totalDown, ulong up, ulong down, List<Mode.ServerStatistics> statistics)
{
try
{
up /= (ulong)(config.statisticsFreshRate / 1000f);
down /= (ulong)(config.statisticsFreshRate / 1000f);
toolSslServerSpeed.Text = string.Format(
"{0}/s↑ | {1}/s↓",
Utils.HumanFy(up),
Utils.HumanFy(down)
);
List<string[]> datas = new List<string[]>();
for (int i = 0; i < config.vmess.Count; i++)
{
string totalUp_ = string.Empty,
totalDown_ = string.Empty,
todayUp_ = string.Empty,
todayDown_ = string.Empty;
var index = statistics.FindIndex(item_ => Utils.IsIdenticalServer(item_, new ServerStatistics(config.vmess[i].remarks, config.vmess[i].address, config.vmess[i].port, config.vmess[i].path, config.vmess[i].requestHost, 0, 0, 0, 0)));
if (index != -1)
{
totalUp_ = Utils.HumanFy(statistics[index].totalUp);
totalDown_ = Utils.HumanFy(statistics[index].totalDown);
todayUp_ = Utils.HumanFy(statistics[index].todayUp);
todayDown_ = Utils.HumanFy(statistics[index].todayDown);
}
datas.Add(new string[] { totalUp_, totalDown_, todayUp_, todayDown_ });
}
lvServers.Invoke((MethodInvoker)delegate
{
lvServers.SuspendLayout();
for (int i = 0; i < datas.Count; i++)
{
var indexStart = 9;
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][0];
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][1];
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][2];
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][3];
}
lvServers.ResumeLayout();
});
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private void MainForm_VisibleChanged(object sender, EventArgs e)
{
if (statistics == null || !statistics.Enable) return;
@@ -87,9 +129,18 @@ namespace v2rayN.Forms
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
statistics?.SaveToFile();
HideForm();
return;
}
if (e.CloseReason == CloseReason.ApplicationExitCall)
{
ConfigHandler.SaveConfig(ref config);
statistics?.SaveToFile();
statistics?.Close();
}
}
private void MainForm_Resize(object sender, EventArgs e)
@@ -109,24 +160,24 @@ namespace v2rayN.Forms
//config.uiItem.mainQRCodeWidth = splitContainer1.SplitterDistance;
}
//private const int WM_QUERYENDSESSION = 0x0011;
//protected override void WndProc(ref Message m)
//{
// switch (m.Msg)
// {
// case WM_QUERYENDSESSION:
// Utils.SaveLog("Windows shutdown UnsetProxy");
// ConfigHandler.ToJsonFile(config);
// statistics?.SaveToFile();
// ProxySetting.UnsetProxy();
// m.Result = (IntPtr)1;
// break;
// default:
// base.WndProc(ref m);
// break;
// }
//}
private const int WM_QUERYENDSESSION = 0x0011;
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_QUERYENDSESSION:
Utils.SaveLog("Windows shutdown UnsetProxy");
//CloseV2ray();
ConfigHandler.ToJsonFile(config);
statistics?.SaveToFile();
ProxySetting.UnsetProxy();
m.Result = (IntPtr)1;
break;
default:
base.WndProc(ref m);
break;
}
}
#endregion
#region 显示服务器 listview 和 menu
@@ -197,7 +248,7 @@ namespace v2rayN.Forms
ListViewItem lvItem = null;
if (statistics != null && statistics.Enable)
{
var index = statistics.Statistic.FindIndex(item_ => item_.itemId == item.getItemId());
var index = statistics.Statistic.FindIndex(item_ => item_.address == item.address);
if (index != -1)
{
totalUp = Utils.HumanFy(statistics.Statistic[index].totalUp);
@@ -268,7 +319,6 @@ namespace v2rayN.Forms
{
menuServers.DropDownItems.Clear();
List<ToolStripMenuItem> lst = new List<ToolStripMenuItem>();
for (int k = 0; k < config.vmess.Count; k++)
{
VmessItem item = config.vmess[k];
@@ -281,9 +331,8 @@ namespace v2rayN.Forms
ts.Checked = true;
}
ts.Click += new EventHandler(ts_Click);
lst.Add(ts);
menuServers.DropDownItems.Add(ts);
}
menuServers.DropDownItems.AddRange(lst.ToArray());
}
private void ts_Click(object sender, EventArgs e)
@@ -316,34 +365,26 @@ namespace v2rayN.Forms
{
return;
}
//qrCodeControl.showQRCode(index, config);
qrCodeControl.showQRCode(index, config);
}
private void DisplayToolStatus()
{
var localIP = "127.0.0.1";
toolSslSocksPort.Text =
toolSslHttpPort.Text =
toolSslPacPort.Text = "NONE";
toolSslSocksPort.Text = $"{Global.Loopback}:{config.inbound[0].localPort}";
toolSslSocksPort.Text = $"{localIP}:{config.inbound[0].localPort}";
if (config.listenerType != 0)
if (config.sysAgentEnabled)
{
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.httpPort}";
toolSslHttpPort.Text = $"{localIP}:{Global.sysAgentPort}";
if (config.listenerType == 2 || config.listenerType == 4)
{
if (PACServerHandle.IsRunning)
{
toolSslPacPort.Text = $"{HttpProxyHandle.GetPacUrl()}";
}
else
{
toolSslPacPort.Text = UIRes.I18N("StartPacFailed");
}
toolSslPacPort.Text = $"{HttpProxyHandle.GetPacUrl()}";
}
}
notifyMain.Icon = MainFormHandler.Instance.GetNotifyIcon(config, this.Icon);
}
private void ssMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
@@ -352,7 +393,6 @@ namespace v2rayN.Forms
Utils.SetClipboardData(e.ClickedItem.Text);
}
}
#endregion
#region v2ray 操作
@@ -368,10 +408,9 @@ namespace v2rayN.Forms
}
v2rayHandler.LoadV2ray(config);
Global.reloadV2ray = false;
ConfigHandler.SaveConfig(ref config, false);
statistics?.SaveToFile();
ChangePACButtonStatus(config.listenerType);
ChangeSysAgent(config.sysAgentEnabled);
DisplayToolStatus();
}
/// <summary>
@@ -379,10 +418,9 @@ namespace v2rayN.Forms
/// </summary>
private void CloseV2ray()
{
ConfigHandler.SaveConfig(ref config, false);
statistics?.SaveToFile();
ConfigHandler.ToJsonFile(config);
ChangePACButtonStatus(0);
ChangeSysAgent(false);
v2rayHandler.V2rayStop();
}
@@ -391,26 +429,6 @@ namespace v2rayN.Forms
#region 功能按钮
private void lvServers_Click(object sender, EventArgs e)
{
int index = -1;
try
{
if (lvServers.SelectedIndices.Count > 0)
{
index = lvServers.SelectedIndices[0];
}
}
catch
{
}
if (index < 0)
{
return;
}
qrCodeControl.showQRCode(index, config);
}
private void lvServers_DoubleClick(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
@@ -472,18 +490,12 @@ namespace v2rayN.Forms
case Keys.A:
menuSelectAll_Click(null, null);
break;
case Keys.P:
menuPingServer_Click(null, null);
break;
case Keys.O:
menuTcpingServer_Click(null, null);
break;
case Keys.R:
menuRealPingServer_Click(null, null);
break;
case Keys.T:
menuSpeedServer_Click(null, null);
break;
case Keys.P:
menuPingServer_Click(null, null);
break;
}
}
switch (e.KeyCode)
@@ -548,6 +560,9 @@ namespace v2rayN.Forms
//刷新
RefreshServers();
LoadV2ray();
// save to config file
ConfigHandler.ToJsonFile(config);
}
private void menuCopyServer_Click(object sender, EventArgs e)
@@ -577,55 +592,101 @@ namespace v2rayN.Forms
private void menuPingServer_Click(object sender, EventArgs e)
{
Speedtest("ping");
}
private void menuTcpingServer_Click(object sender, EventArgs e)
{
Speedtest("tcping");
}
private void menuRealPingServer_Click(object sender, EventArgs e)
{
//if (!config.sysAgentEnabled)
//{
// UI.Show(UIRes.I18N("NeedHttpGlobalProxy"));
// return;
//}
//UI.Show(UIRes.I18N("SpeedServerTips"));
Speedtest("realping");
GetLvSelectedIndex();
ClearTestResult();
bgwPing.RunWorkerAsync();
}
private void menuSpeedServer_Click(object sender, EventArgs e)
{
//if (!config.sysAgentEnabled)
//{
// UI.Show(UIRes.I18N("NeedHttpGlobalProxy"));
// return;
//}
if (!config.sysAgentEnabled || config.listenerType != 1)
{
UI.Show(UIRes.I18N("NeedHttpGlobalProxy"));
return;
}
//UI.Show(UIRes.I18N("SpeedServerTips"));
UI.Show(UIRes.I18N("SpeedServerTips"));
Speedtest("speedtest");
}
private void Speedtest(string actionType)
{
GetLvSelectedIndex();
ClearTestResult();
var statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, actionType, UpdateSpeedtestHandler);
ServerSpeedTest();
}
private void menuExport2ClientConfig_Click(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
MainFormHandler.Instance.Export2ClientConfig(index, config);
if (index < 0)
{
return;
}
if (config.vmess[index].configType != (int)EConfigType.Vmess)
{
UI.Show(UIRes.I18N("NonVmessService"));
return;
}
SaveFileDialog fileDialog = new SaveFileDialog();
fileDialog.Filter = "Config|*.json";
fileDialog.FilterIndex = 2;
fileDialog.RestoreDirectory = true;
if (fileDialog.ShowDialog() != DialogResult.OK)
{
return;
}
string fileName = fileDialog.FileName;
if (Utils.IsNullOrEmpty(fileName))
{
return;
}
Config configCopy = Utils.DeepCopy<Config>(config);
configCopy.index = index;
string msg;
if (V2rayConfigHandler.Export2ClientConfig(configCopy, fileName, out msg) != 0)
{
UI.Show(msg);
}
else
{
UI.Show(string.Format(UIRes.I18N("SaveClientConfigurationIn"), fileName));
}
}
private void menuExport2ServerConfig_Click(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
MainFormHandler.Instance.Export2ServerConfig(index, config);
if (index < 0)
{
return;
}
if (config.vmess[index].configType != (int)EConfigType.Vmess)
{
UI.Show(UIRes.I18N("NonVmessService"));
return;
}
SaveFileDialog fileDialog = new SaveFileDialog();
fileDialog.Filter = "Config|*.json";
fileDialog.FilterIndex = 2;
fileDialog.RestoreDirectory = true;
if (fileDialog.ShowDialog() != DialogResult.OK)
{
return;
}
string fileName = fileDialog.FileName;
if (Utils.IsNullOrEmpty(fileName))
{
return;
}
Config configCopy = Utils.DeepCopy<Config>(config);
configCopy.index = index;
string msg;
if (V2rayConfigHandler.Export2ServerConfig(configCopy, fileName, out msg) != 0)
{
UI.Show(msg);
}
else
{
UI.Show(string.Format(UIRes.I18N("SaveServerConfigurationIn"), fileName));
}
}
private void menuExport2ShareUrl_Click(object sender, EventArgs e)
@@ -880,7 +941,7 @@ namespace v2rayN.Forms
/// <param name="msg"></param>
private void ShowMsg(string msg)
{
if (txtMsgBox.Lines.Length > 999)
if (txtMsgBox.Lines.Length > 500)
{
ClearMsg();
}
@@ -923,10 +984,15 @@ namespace v2rayN.Forms
private void menuExit_Click(object sender, EventArgs e)
{
CloseV2ray();
this.Visible = false;
this.Close();
statistics?.Close();
//this.Dispose();
//System.Environment.Exit(System.Environment.ExitCode);
Application.Exit();
}
@@ -938,7 +1004,6 @@ namespace v2rayN.Forms
this.Activate();
//this.notifyIcon1.Visible = false;
this.ShowInTaskbar = true;
this.txtMsgBox.ScrollToCaret();
SetVisibleCore(true);
}
@@ -947,7 +1012,7 @@ namespace v2rayN.Forms
{
//this.WindowState = FormWindowState.Minimized;
this.Hide();
//this.notifyMain.Icon = this.Icon;
this.notifyMain.Icon = this.Icon;
this.notifyMain.Visible = true;
this.ShowInTaskbar = false;
@@ -958,6 +1023,39 @@ namespace v2rayN.Forms
#region 后台测速
private void bgwPing_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
try
{
for (int k = 0; k < lvSelecteds.Count; k++)
{
int index = lvSelecteds[k];
if (config.vmess[index].configType == (int)EConfigType.Custom)
{
continue;
}
long time = Utils.Ping(config.vmess[index].address);
bgwPing.ReportProgress(index, string.Format("{0}ms", time));
}
}
catch
{
}
}
private void bgwPing_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
{
try
{
int k = e.ProgressPercentage;
string time = string.Format("{0}", Convert.ToString(e.UserState));
SetTestResult(k, time);
}
catch
{
}
}
private void SetTestResult(int k, string txt)
{
config.vmess[k].testResult = txt;
@@ -970,53 +1068,77 @@ namespace v2rayN.Forms
SetTestResult(k, "");
}
}
private void UpdateSpeedtestHandler(int index, string msg)
private int testCounter = 0;
private int ServerSpeedTestSub(int index, string url)
{
lvServers.Invoke((MethodInvoker)delegate
if (index >= lvSelecteds.Count)
{
lvServers.SuspendLayout();
return -1;
}
SetTestResult(index, msg);
if (ConfigHandler.SetDefaultServer(ref config, lvSelecteds[index]) == 0)
{
SetTestResult(lvSelecteds[index], "testing...");
lvServers.ResumeLayout();
});
v2rayHandler.LoadV2ray(config);
v2rayUpdateHandle2.DownloadFileAsync(config, url);
testCounter++;
return 0;
}
else
{
return -1;
}
}
private void UpdateStatisticsHandler(ulong up, ulong down, List<ServerStatItem> statistics)
private void ServerSpeedTest()
{
try
if (config.vmess.Count <= 0)
{
up /= (ulong)(config.statisticsFreshRate / 1000f);
down /= (ulong)(config.statisticsFreshRate / 1000f);
toolSslServerSpeed.Text = string.Format("{0}/s↑ | {1}/s↓", Utils.HumanFy(up), Utils.HumanFy(down));
return;
}
ClearTestResult();
List<string[]> datas = new List<string[]>();
for (int i = 0; i < config.vmess.Count; i++)
string url = Global.SpeedTestUrl;
testCounter = 0;
if (v2rayUpdateHandle2 == null)
{
v2rayUpdateHandle2 = new V2rayUpdateHandle();
v2rayUpdateHandle2.UpdateCompleted += (sender2, args) =>
{
var index = statistics.FindIndex(item_ => item_.itemId == config.vmess[i].getItemId());
if (index != -1)
if (args.Success)
{
lvServers.Invoke((MethodInvoker)delegate
AppendText(false, args.Msg);
SetTestResult(lvSelecteds[testCounter - 1], args.Msg);
if (ServerSpeedTestSub(testCounter, url) != 0)
{
lvServers.SuspendLayout();
var indexStart = 9;
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalUp);
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalDown);
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayUp);
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayDown);
lvServers.ResumeLayout();
});
RefreshServers();
return;
}
}
}
else
{
AppendText(false, args.Msg);
}
};
v2rayUpdateHandle2.Error += (sender2, args) =>
{
SetTestResult(lvSelecteds[testCounter - 1], args.GetException().Message);
AppendText(true, args.GetException().Message);
if (ServerSpeedTestSub(testCounter, url) != 0)
{
RefreshServers();
return;
}
};
}
catch (Exception ex)
if (ServerSpeedTestSub(testCounter, url) != 0)
{
Utils.SaveLog(ex.Message, ex);
return;
}
}
#endregion
#region 移动服务器
@@ -1073,58 +1195,96 @@ namespace v2rayN.Forms
Utils.SetClipboardData(HttpProxyHandle.GetPacUrl());
}
private void menuNotEnabledHttp_Click(object sender, EventArgs e)
private void menuSysAgentEnabled_Click(object sender, EventArgs e)
{
SetListenerType(0);
bool isChecked = !config.sysAgentEnabled;
config.sysAgentEnabled = isChecked;
ChangeSysAgent(isChecked);
}
private void menuGlobal_Click(object sender, EventArgs e)
{
SetListenerType(1);
config.listenerType = 1;
ChangePACButtonStatus(config.listenerType);
}
private void menuGlobalPAC_Click(object sender, EventArgs e)
{
SetListenerType(2);
config.listenerType = 2;
ChangePACButtonStatus(config.listenerType);
}
private void menuKeep_Click(object sender, EventArgs e)
{
SetListenerType(3);
config.listenerType = 3;
ChangePACButtonStatus(config.listenerType);
}
private void menuKeepPAC_Click(object sender, EventArgs e)
{
SetListenerType(4);
}
private void SetListenerType(int type)
{
config.listenerType = type;
ChangePACButtonStatus(type);
config.listenerType = 4;
ChangePACButtonStatus(config.listenerType);
}
private void ChangePACButtonStatus(int type)
{
if (type != 0)
if (HttpProxyHandle.Update(config, false))
{
HttpProxyHandle.RestartHttpAgent(config, false);
switch (type)
{
case 1:
menuGlobal.Checked = true;
menuGlobalPAC.Checked = false;
menuKeep.Checked = false;
menuKeepPAC.Checked = false;
break;
case 2:
menuGlobal.Checked = false;
menuGlobalPAC.Checked = true;
menuKeep.Checked = false;
menuKeepPAC.Checked = false;
break;
case 3:
menuGlobal.Checked = false;
menuGlobalPAC.Checked = false;
menuKeep.Checked = true;
menuKeepPAC.Checked = false;
break;
case 4:
menuGlobal.Checked = false;
menuGlobalPAC.Checked = false;
menuKeep.Checked = false;
menuKeepPAC.Checked = true;
break;
}
}
else
{
HttpProxyHandle.CloseHttpAgent(config);
}
for (int k = 0; k < menuSysAgentMode.DropDownItems.Count; k++)
{
var item = ((ToolStripMenuItem)menuSysAgentMode.DropDownItems[k]);
item.Checked = (type == k);
}
ConfigHandler.SaveConfig(ref config, false);
DisplayToolStatus();
}
/// <summary>
/// 改变系统代理
/// </summary>
/// <param name="isChecked"></param>
private void ChangeSysAgent(bool isChecked)
{
if (isChecked)
{
if (HttpProxyHandle.RestartHttpAgent(config, true))
{
ChangePACButtonStatus(config.listenerType);
}
}
else
{
HttpProxyHandle.Update(config, true);
HttpProxyHandle.CloseHttpAgent(config);
}
menuSysAgentEnabled.Checked =
menuSysAgentMode.Enabled = isChecked;
DisplayToolStatus();
}
#endregion
@@ -1137,10 +1297,10 @@ namespace v2rayN.Forms
private void tsbCheckUpdateCore_Click(object sender, EventArgs e)
{
if (downloadHandle == null)
if (v2rayUpdateHandle == null)
{
downloadHandle = new DownloadHandle();
downloadHandle.AbsoluteCompleted += (sender2, args) =>
v2rayUpdateHandle = new V2rayUpdateHandle();
v2rayUpdateHandle.AbsoluteCompleted += (sender2, args) =>
{
if (args.Success)
{
@@ -1156,7 +1316,7 @@ namespace v2rayN.Forms
}
else
{
downloadHandle.DownloadFileAsync(config, url, null, -1);
v2rayUpdateHandle.DownloadFileAsync(config, url);
}
}));
}
@@ -1165,7 +1325,7 @@ namespace v2rayN.Forms
AppendText(false, args.Msg);
}
};
downloadHandle.UpdateCompleted += (sender2, args) =>
v2rayUpdateHandle.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
@@ -1176,7 +1336,7 @@ namespace v2rayN.Forms
{
CloseV2ray();
string fileName = downloadHandle.DownloadFileName;
string fileName = v2rayUpdateHandle.DownloadFileName;
fileName = Utils.GetPath(fileName);
using (ZipArchive archive = ZipFile.OpenRead(fileName))
{
@@ -1204,14 +1364,14 @@ namespace v2rayN.Forms
AppendText(false, args.Msg);
}
};
downloadHandle.Error += (sender2, args) =>
v2rayUpdateHandle.Error += (sender2, args) =>
{
AppendText(true, args.GetException().Message);
};
}
AppendText(false, UIRes.I18N("MsgStartUpdatingV2rayCore"));
downloadHandle.AbsoluteV2rayCore(config);
v2rayUpdateHandle.AbsoluteV2rayCore(config);
}
private void tsbCheckUpdatePACList_Click(object sender, EventArgs e)
@@ -1263,7 +1423,7 @@ namespace v2rayN.Forms
private void tsbPromotion_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}");
System.Diagnostics.Process.Start(Global.PromotionUrl);
}
#endregion
@@ -1331,8 +1491,8 @@ namespace v2rayN.Forms
continue;
}
DownloadHandle downloadHandle3 = new DownloadHandle();
downloadHandle3.UpdateCompleted += (sender2, args) =>
V2rayUpdateHandle v2rayUpdateHandle3 = new V2rayUpdateHandle();
v2rayUpdateHandle3.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
@@ -1361,12 +1521,12 @@ namespace v2rayN.Forms
AppendText(false, args.Msg);
}
};
downloadHandle3.Error += (sender2, args) =>
v2rayUpdateHandle3.Error += (sender2, args) =>
{
AppendText(true, args.GetException().Message);
};
downloadHandle3.WebDownloadString(url);
v2rayUpdateHandle3.WebDownloadString(url);
AppendText(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}");
}
@@ -1391,8 +1551,7 @@ namespace v2rayN.Forms
Utils.RegWriteValue(Global.MyRegPath, Global.MyRegKeyLanguage, value);
}
#endregion
}
}
+28 -43
View File
@@ -231,19 +231,7 @@
<value>447, 22</value>
</data>
<data name="menuPingServer.Text" xml:space="preserve">
<value>Test server ping (multiple choice)(Ctrl+P)</value>
</data>
<data name="menuTcpingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>447, 22</value>
</data>
<data name="menuTcpingServer.Text" xml:space="preserve">
<value>Test server tcping (multiple choice)(Ctrl+O)</value>
</data>
<data name="menuRealPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>447, 22</value>
</data>
<data name="menuRealPingServer.Text" xml:space="preserve">
<value>Test server real ping (multiple choice)(Ctrl+R)</value>
<value>Test server delay (multiple choice)(Ctrl+P)</value>
</data>
<data name="menuSpeedServer.Size" type="System.Drawing.Size, System.Drawing">
<value>447, 22</value>
@@ -291,7 +279,7 @@
<value>ImageAboveText</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>448, 534</value>
<value>448, 490</value>
</data>
<data name="&gt;&gt;cmsLv.Name" xml:space="preserve">
<value>cmsLv</value>
@@ -333,7 +321,7 @@
<value>lvServers</value>
</data>
<data name="&gt;&gt;lvServers.Type" xml:space="preserve">
<value>v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>v2rayN.Forms.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvServers.Parent" xml:space="preserve">
<value>splitContainer1.Panel1</value>
@@ -422,11 +410,11 @@
<data name="cmsMain.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 22</value>
<data name="menuSysAgentEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value>
</data>
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
<value>Not Enabled Http Proxy</value>
<data name="menuSysAgentEnabled.Text" xml:space="preserve">
<value>Enable Http proxy</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 22</value>
@@ -456,7 +444,7 @@
<value>264, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http proxy</value>
<value>Http proxy mode</value>
</data>
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value>
@@ -492,7 +480,7 @@
<value>Exit</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>265, 142</value>
<value>265, 164</value>
</data>
<data name="&gt;&gt;cmsMain.Name" xml:space="preserve">
<value>cmsMain</value>
@@ -506,6 +494,9 @@
<data name="notifyMain.Visible" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<metadata name="bgwPing.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>232, 17</value>
</metadata>
<metadata name="bgwScan.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>498, 17</value>
</metadata>
@@ -570,7 +561,7 @@
<value>0</value>
</data>
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>228, 18</value>
<value>603, 17</value>
</metadata>
<data name="toolSslSocksPortLab.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
@@ -588,7 +579,7 @@
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 17</value>
<value>188, 17</value>
</data>
<data name="toolSslHttpPortLab.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
@@ -606,7 +597,7 @@
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 17</value>
<value>188, 17</value>
</data>
<data name="toolSslPacPortLab.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
@@ -624,7 +615,7 @@
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslBlank3.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 17</value>
<value>188, 17</value>
</data>
<data name="toolSslServerSpeed.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
@@ -1058,18 +1049,6 @@
<data name="&gt;&gt;menuPingServer.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuTcpingServer.Name" xml:space="preserve">
<value>menuTcpingServer</value>
</data>
<data name="&gt;&gt;menuTcpingServer.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuRealPingServer.Name" xml:space="preserve">
<value>menuRealPingServer</value>
</data>
<data name="&gt;&gt;menuRealPingServer.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuSpeedServer.Name" xml:space="preserve">
<value>menuSpeedServer</value>
</data>
@@ -1118,18 +1097,18 @@
<data name="&gt;&gt;notifyMain.Type" xml:space="preserve">
<value>System.Windows.Forms.NotifyIcon, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuSysAgentEnabled.Name" xml:space="preserve">
<value>menuSysAgentEnabled</value>
</data>
<data name="&gt;&gt;menuSysAgentEnabled.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuSysAgentMode.Name" xml:space="preserve">
<value>menuSysAgentMode</value>
</data>
<data name="&gt;&gt;menuSysAgentMode.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuNotEnabledHttp.Name" xml:space="preserve">
<value>menuNotEnabledHttp</value>
</data>
<data name="&gt;&gt;menuNotEnabledHttp.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuGlobal.Name" xml:space="preserve">
<value>menuGlobal</value>
</data>
@@ -1190,6 +1169,12 @@
<data name="&gt;&gt;menuExit.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;bgwPing.Name" xml:space="preserve">
<value>bgwPing</value>
</data>
<data name="&gt;&gt;bgwPing.Type" xml:space="preserve">
<value>System.ComponentModel.BackgroundWorker, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;bgwScan.Name" xml:space="preserve">
<value>bgwScan</value>
</data>
+77 -80
View File
@@ -119,151 +119,139 @@
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="menuAddVmessServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuAddVmessServer.Text" xml:space="preserve">
<value>添加[VMess]服务器</value>
</data>
<data name="menuAddShadowsocksServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuAddShadowsocksServer.Text" xml:space="preserve">
<value>添加[Shadowsocks]服务器</value>
</data>
<data name="menuAddSocksServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuAddSocksServer.Text" xml:space="preserve">
<value>添加[Socks]服务器</value>
</data>
<data name="menuAddCustomServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuAddCustomServer.Text" xml:space="preserve">
<value>添加自定义配置服务器</value>
</data>
<data name="menuAddServers.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuAddServers.Text" xml:space="preserve">
<value>从剪贴板导入批量URL</value>
</data>
<data name="menuScanScreen.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuScanScreen.Text" xml:space="preserve">
<value>扫描屏幕上的二维码</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>249, 6</value>
</data>
<data name="menuRemoveServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuRemoveServer.Text" xml:space="preserve">
<value>移除所选服务器(多选) (Delete)</value>
</data>
<data name="menuRemoveDuplicateServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuRemoveDuplicateServer.Text" xml:space="preserve">
<value>移除重复的服务器</value>
</data>
<data name="menuCopyServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuCopyServer.Text" xml:space="preserve">
<value>复制所选服务器</value>
</data>
<data name="menuSetDefaultServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuSetDefaultServer.Text" xml:space="preserve">
<value>设为活动服务器 (Enter)</value>
</data>
<data name="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>249, 6</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuMoveTop.Text" xml:space="preserve">
<value>上移至顶</value>
</data>
<data name="menuMoveUp.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuMoveUp.Text" xml:space="preserve">
<value>上移 (U)</value>
</data>
<data name="menuMoveDown.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuMoveDown.Text" xml:space="preserve">
<value>下移 (D)</value>
</data>
<data name="menuMoveBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>下移至底</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
</data>
<data name="toolStripSeparator9.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>249, 6</value>
</data>
<data name="menuPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuPingServer.Text" xml:space="preserve">
<value>测试服务器延迟Ping(多选)(Ctrl+P)</value>
</data>
<data name="menuTcpingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
</data>
<data name="menuTcpingServer.Text" xml:space="preserve">
<value>测试服务器延迟Tcping(多选)(Ctrl+O)</value>
</data>
<data name="menuRealPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
</data>
<data name="menuRealPingServer.Text" xml:space="preserve">
<value>测试服务器真连接延迟(多选)(Ctrl+R)</value>
<value>测试服务器延迟(多选)(Ctrl+P)</value>
</data>
<data name="menuSpeedServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuSpeedServer.Text" xml:space="preserve">
<value>测试服务器速度(多选)(Ctrl+T)</value>
</data>
<data name="toolStripSeparator6.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>249, 6</value>
</data>
<data name="menuExport2ClientConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuExport2ClientConfig.Text" xml:space="preserve">
<value>导出所选服务器为客户端配置</value>
</data>
<data name="menuExport2ServerConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuExport2ServerConfig.Text" xml:space="preserve">
<value>导出所选服务器为服务端配置</value>
</data>
<data name="menuExport2ShareUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuExport2ShareUrl.Text" xml:space="preserve">
<value>批量导出分享URL至剪贴板(多选)</value>
</data>
<data name="menuExport2SubContent.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuExport2SubContent.Text" xml:space="preserve">
<value>批量导出订阅内容至剪贴板(多选)</value>
@@ -275,7 +263,7 @@
<value> 服务器 </value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>279, 534</value>
<value>253, 490</value>
</data>
<data name="lvServers.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
@@ -294,11 +282,20 @@
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
<value>340, 22</value>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 164</value>
</data>
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
<value>关闭Http代理</value>
<data name="menuSysAgentEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuSysAgentEnabled.Text" xml:space="preserve">
<value>启用Http代理</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http代理模式</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>340, 22</value>
@@ -324,12 +321,6 @@
<data name="menuKeepPAC.Text" xml:space="preserve">
<value>仅开启PAC,不自动配置PAC</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http代理</value>
</data>
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
@@ -363,18 +354,27 @@
<data name="menuExit.Text" xml:space="preserve">
<value>退出</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 142</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器列表</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>176, 17</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>176, 17</value>
</data>
<data name="toolSslBlank3.Size" type="System.Drawing.Size, System.Drawing">
<value>176, 17</value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
</data>
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 22</value>
</data>
@@ -387,12 +387,6 @@
<data name="tsbSubUpdate.Text" xml:space="preserve">
<value>更新订阅</value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
</data>
<data name="tsbOptionSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 53</value>
</data>
@@ -401,13 +395,13 @@
</data>
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3
NQwF4JkcFRWiUAB7IVW2FFPO3YqlgPd+LJf02e8Fdi3rMdIAcLDuf9UpeT0IS0G/hvhPm305vSl7EQFY
B6zCvozvYGzRM8zEoeg5TPZwDaGvpHQni1yzSxbXPW9q+hF13ROHuJnQcjbhtQAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAATdJREFUWEftloENAiEMRW8ER3AEN9ANdARHcAPdwBF0A91AN9INtC+5JvUCJwWM
mvCTFw3QUiiU65qa/lUTYT6Ato9rJZyERwT6GFNdU+EihCYNwVhsqmgm3AR1fheOAitd9PCfNvp0HDbY
FolV2MmZZCzX9J0FG0TRTlwFdbahIVE7Qe1IR5bYVnXCyr2yO5F1MNUBec25YtjomcCXSxhr9DmrV2Gr
flyL4GSrYcm9tmnEZ7JsAC7DgWr5ydbXA8hOAcVjG8FTD6ocQgvXKrW8MqFWUfc1DAXgmRwVFaJQAHsh
VbYUU87diqWA934sl/TZ7wV2Lesx0gBwsO5/1Sl5PQhLQb+G+E+bfTm9KXsRAVgHrMK+jO9gbNEzzMSh
6DlM9nANoa+kdCeLXLNLFtc9b2r6EXXdE4e4mdByNuG1AAAAAElFTkSuQmCC
</value>
</data>
<data name="tsbReload.Size" type="System.Drawing.Size, System.Drawing">
@@ -416,6 +410,12 @@
<data name="tsbReload.Text" xml:space="preserve">
<value> 重启服务 </value>
</data>
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>85, 53</value>
</data>
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value> 检查更新 </value>
</data>
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 22</value>
</data>
@@ -440,21 +440,15 @@
<data name="tsbCheckClearPACList.Text" xml:space="preserve">
<value>简化PAC (请设置Core路由)</value>
</data>
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>85, 53</value>
</data>
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value> 检查更新 </value>
</data>
<data name="tsbAbout.Text" xml:space="preserve">
<value>关于</value>
</data>
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 53</value>
</data>
<data name="tsbHelp.Text" xml:space="preserve">
<value> 帮助 </value>
</data>
<data name="tsbAbout.Text" xml:space="preserve">
<value>关于</value>
</data>
<data name="tsbPromotion.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 53</value>
</data>
@@ -463,12 +457,15 @@
</data>
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAADJJREFUWEftzrENACAIRUFGdVMdTZkAG4zFXfI68kMAAD8ap9lUbpfyaDV19QAA
8FDEBl3RImu5VcdbAAAAAElFTkSuQmCC
</value>
</data>
<data name="tsbClose.Text" xml:space="preserve">
<value> 关闭 </value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
</root>
+55 -57
View File
@@ -28,13 +28,12 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionSettingForm));
this.btnClose = new System.Windows.Forms.Button();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label16 = new System.Windows.Forms.Label();
this.cmblistenerType = new System.Windows.Forms.ComboBox();
this.chksniffingEnabled2 = new System.Windows.Forms.CheckBox();
this.chksniffingEnabled = new System.Windows.Forms.CheckBox();
this.txtremoteDNS = new System.Windows.Forms.TextBox();
@@ -62,13 +61,13 @@
this.txtUserdirect = new System.Windows.Forms.TextBox();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.txtUserblock = new System.Windows.Forms.TextBox();
this.tabPage8 = new System.Windows.Forms.TabPage();
this.cmbroutingMode = new System.Windows.Forms.ComboBox();
this.panel3 = new System.Windows.Forms.Panel();
this.btnSetDefRountingRule = new System.Windows.Forms.Button();
this.labRoutingTips = new System.Windows.Forms.Label();
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
this.labRoutingTips = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.cmbroutingMode = new System.Windows.Forms.ComboBox();
this.tabPage6 = new System.Windows.Forms.TabPage();
this.chkKcpcongestion = new System.Windows.Forms.CheckBox();
this.txtKcpwriteBufferSize = new System.Windows.Forms.TextBox();
@@ -85,7 +84,9 @@
this.label6 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.cbFreshrate = new System.Windows.Forms.ComboBox();
this.tbCacheDays = new System.Windows.Forms.TextBox();
this.lbFreshrate = new System.Windows.Forms.Label();
this.lbCacheDays = new System.Windows.Forms.Label();
this.chkEnableStatistics = new System.Windows.Forms.CheckBox();
this.chkAllowLANConn = new System.Windows.Forms.CheckBox();
this.txturlGFWList = new System.Windows.Forms.TextBox();
@@ -94,6 +95,7 @@
this.panel2 = new System.Windows.Forms.Panel();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.configBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
@@ -103,11 +105,11 @@
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout();
this.tabPage8.SuspendLayout();
this.panel3.SuspendLayout();
this.tabPage6.SuspendLayout();
this.tabPage7.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.configBindingSource)).BeginInit();
this.SuspendLayout();
//
// btnClose
@@ -137,8 +139,6 @@
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label16);
this.groupBox1.Controls.Add(this.cmblistenerType);
this.groupBox1.Controls.Add(this.chksniffingEnabled2);
this.groupBox1.Controls.Add(this.chksniffingEnabled);
this.groupBox1.Controls.Add(this.txtremoteDNS);
@@ -161,24 +161,6 @@
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// label16
//
resources.ApplyResources(this.label16, "label16");
this.label16.Name = "label16";
//
// cmblistenerType
//
this.cmblistenerType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmblistenerType.FormattingEnabled = true;
this.cmblistenerType.Items.AddRange(new object[] {
resources.GetString("cmblistenerType.Items"),
resources.GetString("cmblistenerType.Items1"),
resources.GetString("cmblistenerType.Items2"),
resources.GetString("cmblistenerType.Items3"),
resources.GetString("cmblistenerType.Items4")});
resources.ApplyResources(this.cmblistenerType, "cmblistenerType");
this.cmblistenerType.Name = "cmblistenerType";
//
// chksniffingEnabled2
//
resources.ApplyResources(this.chksniffingEnabled2, "chksniffingEnabled2");
@@ -315,7 +297,6 @@
this.tabControl2.Controls.Add(this.tabPage3);
this.tabControl2.Controls.Add(this.tabPage4);
this.tabControl2.Controls.Add(this.tabPage5);
this.tabControl2.Controls.Add(this.tabPage8);
resources.ApplyResources(this.tabControl2, "tabControl2");
this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0;
@@ -356,31 +337,14 @@
resources.ApplyResources(this.txtUserblock, "txtUserblock");
this.txtUserblock.Name = "txtUserblock";
//
// tabPage8
//
this.tabPage8.Controls.Add(this.cmbroutingMode);
resources.ApplyResources(this.tabPage8, "tabPage8");
this.tabPage8.Name = "tabPage8";
this.tabPage8.UseVisualStyleBackColor = true;
//
// cmbroutingMode
//
this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbroutingMode.FormattingEnabled = true;
this.cmbroutingMode.Items.AddRange(new object[] {
resources.GetString("cmbroutingMode.Items"),
resources.GetString("cmbroutingMode.Items1"),
resources.GetString("cmbroutingMode.Items2"),
resources.GetString("cmbroutingMode.Items3")});
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
this.cmbroutingMode.Name = "cmbroutingMode";
//
// panel3
//
this.panel3.Controls.Add(this.btnSetDefRountingRule);
this.panel3.Controls.Add(this.labRoutingTips);
this.panel3.Controls.Add(this.cmbdomainStrategy);
this.panel3.Controls.Add(this.labRoutingTips);
this.panel3.Controls.Add(this.label15);
this.panel3.Controls.Add(this.label12);
this.panel3.Controls.Add(this.cmbroutingMode);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3";
//
@@ -391,12 +355,6 @@
this.btnSetDefRountingRule.UseVisualStyleBackColor = true;
this.btnSetDefRountingRule.Click += new System.EventHandler(this.btnSetDefRountingRule_Click);
//
// labRoutingTips
//
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.Name = "labRoutingTips";
//
// cmbdomainStrategy
//
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -408,11 +366,34 @@
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
//
// labRoutingTips
//
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.Name = "labRoutingTips";
//
// label15
//
resources.ApplyResources(this.label15, "label15");
this.label15.Name = "label15";
//
// label12
//
resources.ApplyResources(this.label12, "label12");
this.label12.Name = "label12";
//
// cmbroutingMode
//
this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbroutingMode.FormattingEnabled = true;
this.cmbroutingMode.Items.AddRange(new object[] {
resources.GetString("cmbroutingMode.Items"),
resources.GetString("cmbroutingMode.Items1"),
resources.GetString("cmbroutingMode.Items2"),
resources.GetString("cmbroutingMode.Items3")});
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
this.cmbroutingMode.Name = "cmbroutingMode";
//
// tabPage6
//
this.tabPage6.Controls.Add(this.chkKcpcongestion);
@@ -501,7 +482,9 @@
// tabPage7
//
this.tabPage7.Controls.Add(this.cbFreshrate);
this.tabPage7.Controls.Add(this.tbCacheDays);
this.tabPage7.Controls.Add(this.lbFreshrate);
this.tabPage7.Controls.Add(this.lbCacheDays);
this.tabPage7.Controls.Add(this.chkEnableStatistics);
this.tabPage7.Controls.Add(this.chkAllowLANConn);
this.tabPage7.Controls.Add(this.txturlGFWList);
@@ -518,11 +501,21 @@
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.Name = "cbFreshrate";
//
// tbCacheDays
//
resources.ApplyResources(this.tbCacheDays, "tbCacheDays");
this.tbCacheDays.Name = "tbCacheDays";
//
// lbFreshrate
//
resources.ApplyResources(this.lbFreshrate, "lbFreshrate");
this.lbFreshrate.Name = "lbFreshrate";
//
// lbCacheDays
//
resources.ApplyResources(this.lbCacheDays, "lbCacheDays");
this.lbCacheDays.Name = "lbCacheDays";
//
// chkEnableStatistics
//
resources.ApplyResources(this.chkEnableStatistics, "chkEnableStatistics");
@@ -570,6 +563,10 @@
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// configBindingSource
//
this.configBindingSource.DataSource = typeof(v2rayN.Mode.Config);
//
// OptionSettingForm
//
resources.ApplyResources(this, "$this");
@@ -594,7 +591,6 @@
this.tabPage4.PerformLayout();
this.tabPage5.ResumeLayout(false);
this.tabPage5.PerformLayout();
this.tabPage8.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.tabPage6.ResumeLayout(false);
@@ -602,6 +598,7 @@
this.tabPage7.ResumeLayout(false);
this.tabPage7.PerformLayout();
this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.configBindingSource)).EndInit();
this.ResumeLayout(false);
}
@@ -663,15 +660,16 @@
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.ComboBox cmbdomainStrategy;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.ComboBox cmbroutingMode;
private System.Windows.Forms.CheckBox chksniffingEnabled;
private System.Windows.Forms.CheckBox chksniffingEnabled2;
private System.Windows.Forms.Button btnSetDefRountingRule;
private System.Windows.Forms.CheckBox chkEnableStatistics;
private System.Windows.Forms.TextBox tbCacheDays;
private System.Windows.Forms.Label lbCacheDays;
private System.Windows.Forms.ComboBox cbFreshrate;
private System.Windows.Forms.Label lbFreshrate;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.ComboBox cmblistenerType;
private System.Windows.Forms.TabPage tabPage8;
private System.Windows.Forms.BindingSource configBindingSource;
}
}
+20 -30
View File
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Base;
namespace v2rayN.Forms
{
@@ -43,10 +42,6 @@ namespace v2rayN.Forms
cmbprotocol.Text = config.inbound[0].protocol.ToString();
chkudpEnabled.Checked = config.inbound[0].udpEnabled;
chksniffingEnabled.Checked = config.inbound[0].sniffingEnabled;
txtlocalPort2.Text = $"{config.inbound[0].localPort + 1}";
cmbprotocol2.Text = Global.InboundHttp;
if (config.inbound.Count > 1)
{
txtlocalPort2.Text = config.inbound[1].localPort.ToString();
@@ -64,8 +59,6 @@ namespace v2rayN.Forms
//remoteDNS
txtremoteDNS.Text = config.remoteDNS;
cmblistenerType.SelectedIndex = config.listenerType;
}
/// <summary>
@@ -115,6 +108,8 @@ namespace v2rayN.Forms
var enableStatistics = config.enableStatistics;
chkEnableStatistics.Checked = enableStatistics;
tbCacheDays.Text = config.CacheDays.ToString();
var cbSource = new ComboItem[]
{
@@ -127,7 +122,7 @@ namespace v2rayN.Forms
cbFreshrate.DisplayMember = "Text";
cbFreshrate.ValueMember = "ID";
switch (config.statisticsFreshRate)
switch(config.statisticsFreshRate)
{
case (int)Global.StatisticsFreshRate.quick:
cbFreshrate.SelectedItem = cbSource[0];
@@ -250,8 +245,7 @@ namespace v2rayN.Forms
//remoteDNS
config.remoteDNS = txtremoteDNS.Text.TrimEx();
config.listenerType = cmblistenerType.SelectedIndex;
return 0;
}
@@ -330,6 +324,13 @@ namespace v2rayN.Forms
var lastEnableStatistics = config.enableStatistics;
config.enableStatistics = chkEnableStatistics.Checked;
uint days = 0;
var valid = uint.TryParse(tbCacheDays.Text, out days);
if (!valid)
days = 7;
config.CacheDays = days;
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue;
//if(lastEnableStatistics != config.enableStatistics)
@@ -363,15 +364,10 @@ namespace v2rayN.Forms
private void btnSetDefRountingRule_Click(object sender, EventArgs e)
{
txtUseragent.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.agentTag);
txtUserdirect.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.directTag);
txtUserblock.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.blockTag);
cmbroutingMode.SelectedIndex = 3;
var lstUrl = new List<string>();
lstUrl.Add(Global.CustomRoutingListUrl + Global.agentTag);
lstUrl.Add(Global.CustomRoutingListUrl + Global.directTag);
lstUrl.Add(Global.CustomRoutingListUrl + Global.blockTag);
lstUrl.Add(Global.CustomRoutingListUrl + "proxy");
lstUrl.Add(Global.CustomRoutingListUrl + "direct");
lstUrl.Add(Global.CustomRoutingListUrl + "block");
var lstTxt = new List<TextBox>();
lstTxt.Add(txtUseragent);
@@ -381,8 +377,8 @@ namespace v2rayN.Forms
for (int k = 0; k < lstUrl.Count; k++)
{
var txt = lstTxt[k];
DownloadHandle downloadHandle = new DownloadHandle();
downloadHandle.UpdateCompleted += (sender2, args) =>
V2rayUpdateHandle v2rayUpdateHandle3 = new V2rayUpdateHandle();
v2rayUpdateHandle3.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
@@ -398,12 +394,12 @@ namespace v2rayN.Forms
AppendText(false, args.Msg);
}
};
downloadHandle.Error += (sender2, args) =>
v2rayUpdateHandle3.Error += (sender2, args) =>
{
AppendText(true, args.GetException().Message);
};
downloadHandle.WebDownloadString(lstUrl[k]);
v2rayUpdateHandle3.WebDownloadString(lstUrl[k]);
}
}
void AppendText(bool notify, string text)
@@ -414,13 +410,7 @@ namespace v2rayN.Forms
class ComboItem
{
public int ID
{
get; set;
}
public string Text
{
get; set;
}
public int ID { get; set; }
public string Text { get; set; }
}
}
+209 -224
View File
@@ -143,76 +143,10 @@
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label16.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label16.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label16.Location" type="System.Drawing.Point, System.Drawing">
<value>42, 98</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label16.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="label16.Text" xml:space="preserve">
<value>Http proxy</value>
</data>
<data name="&gt;&gt;label16.Name" xml:space="preserve">
<value>label16</value>
</data>
<data name="&gt;&gt;label16.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label16.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label16.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="cmblistenerType.Items" xml:space="preserve">
<value>Not Enabled Http Proxy</value>
</data>
<data name="cmblistenerType.Items1" xml:space="preserve">
<value>Open Http proxy and automatically configure proxy server (global mode)</value>
</data>
<data name="cmblistenerType.Items2" xml:space="preserve">
<value>Open PAC and automatically configure PAC (PAC mode)</value>
</data>
<data name="cmblistenerType.Items3" xml:space="preserve">
<value>Only open Http proxy, do not automatically configure proxy server (direct mode)</value>
</data>
<data name="cmblistenerType.Items4" xml:space="preserve">
<value>Only open PAC, do not automatically configure PAC</value>
</data>
<data name="cmblistenerType.Location" type="System.Drawing.Point, System.Drawing">
<value>124, 94</value>
</data>
<data name="cmblistenerType.Size" type="System.Drawing.Size, System.Drawing">
<value>464, 20</value>
</data>
<data name="cmblistenerType.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="&gt;&gt;cmblistenerType.Name" xml:space="preserve">
<value>cmblistenerType</value>
</data>
<data name="&gt;&gt;cmblistenerType.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmblistenerType.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;cmblistenerType.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="chksniffingEnabled2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="chksniffingEnabled2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
@@ -241,7 +175,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;chksniffingEnabled2.ZOrder" xml:space="preserve">
<value>2</value>
<value>0</value>
</data>
<data name="chksniffingEnabled.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -271,10 +205,10 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;chksniffingEnabled.ZOrder" xml:space="preserve">
<value>3</value>
<value>1</value>
</data>
<data name="txtremoteDNS.Location" type="System.Drawing.Point, System.Drawing">
<value>33, 228</value>
<value>33, 192</value>
</data>
<data name="txtremoteDNS.Size" type="System.Drawing.Size, System.Drawing">
<value>402, 21</value>
@@ -292,13 +226,13 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtremoteDNS.ZOrder" xml:space="preserve">
<value>4</value>
<value>2</value>
</data>
<data name="label14.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label14.Location" type="System.Drawing.Point, System.Drawing">
<value>33, 204</value>
<value>33, 168</value>
</data>
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
<value>281, 12</value>
@@ -319,13 +253,13 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label14.ZOrder" xml:space="preserve">
<value>5</value>
<value>3</value>
</data>
<data name="chkmuxEnabled.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="chkmuxEnabled.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 129</value>
<value>15, 93</value>
</data>
<data name="chkmuxEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>174, 16</value>
@@ -346,7 +280,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;chkmuxEnabled.ZOrder" xml:space="preserve">
<value>6</value>
<value>4</value>
</data>
<data name="chkAllowIn2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -376,7 +310,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;chkAllowIn2.ZOrder" xml:space="preserve">
<value>7</value>
<value>5</value>
</data>
<data name="chkudpEnabled2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -406,7 +340,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;chkudpEnabled2.ZOrder" xml:space="preserve">
<value>8</value>
<value>6</value>
</data>
<data name="cmbprotocol2.Items" xml:space="preserve">
<value>socks</value>
@@ -436,7 +370,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;cmbprotocol2.ZOrder" xml:space="preserve">
<value>9</value>
<value>7</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -466,7 +400,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>10</value>
<value>8</value>
</data>
<data name="txtlocalPort2.Location" type="System.Drawing.Point, System.Drawing">
<value>124, 60</value>
@@ -490,7 +424,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtlocalPort2.ZOrder" xml:space="preserve">
<value>11</value>
<value>9</value>
</data>
<data name="cmbprotocol.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
@@ -520,7 +454,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;cmbprotocol.ZOrder" xml:space="preserve">
<value>12</value>
<value>10</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -547,7 +481,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>13</value>
<value>11</value>
</data>
<data name="chkudpEnabled.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -574,13 +508,13 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;chkudpEnabled.ZOrder" xml:space="preserve">
<value>14</value>
<value>12</value>
</data>
<data name="chklogEnabled.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="chklogEnabled.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 160</value>
<value>15, 124</value>
</data>
<data name="chklogEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>126, 16</value>
@@ -601,7 +535,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;chklogEnabled.ZOrder" xml:space="preserve">
<value>15</value>
<value>13</value>
</data>
<data name="cmbloglevel.Items" xml:space="preserve">
<value>debug</value>
@@ -619,7 +553,7 @@
<value>none</value>
</data>
<data name="cmbloglevel.Location" type="System.Drawing.Point, System.Drawing">
<value>257, 158</value>
<value>257, 122</value>
</data>
<data name="cmbloglevel.Size" type="System.Drawing.Size, System.Drawing">
<value>97, 20</value>
@@ -637,13 +571,13 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;cmbloglevel.ZOrder" xml:space="preserve">
<value>16</value>
<value>14</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
<value>193, 162</value>
<value>193, 126</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 12</value>
@@ -664,7 +598,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>17</value>
<value>15</value>
</data>
<data name="txtlocalPort.Location" type="System.Drawing.Point, System.Drawing">
<value>124, 25</value>
@@ -685,7 +619,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtlocalPort.ZOrder" xml:space="preserve">
<value>18</value>
<value>16</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -712,7 +646,7 @@
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>19</value>
<value>17</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@@ -721,7 +655,7 @@
<value>3, 3</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>648, 573</value>
<value>624, 573</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
@@ -745,7 +679,7 @@
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage1.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 579</value>
<value>630, 579</value>
</data>
<data name="tabPage1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -771,9 +705,6 @@
<data name="txtUseragent.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="txtUseragent.MaxLength" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="txtUseragent.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@@ -781,7 +712,7 @@
<value>Vertical</value>
</data>
<data name="txtUseragent.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 454</value>
<value>604, 414</value>
</data>
<data name="txtUseragent.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@@ -805,13 +736,13 @@
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 460</value>
<value>610, 420</value>
</data>
<data name="tabPage3.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value>1.Proxy Domain or IP</value>
<value>Proxy's Domain or IP</value>
</data>
<data name="&gt;&gt;tabPage3.Name" xml:space="preserve">
<value>tabPage3</value>
@@ -831,9 +762,6 @@
<data name="txtUserdirect.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="txtUserdirect.MaxLength" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="txtUserdirect.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@@ -841,7 +769,7 @@
<value>Vertical</value>
</data>
<data name="txtUserdirect.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 454</value>
<value>604, 414</value>
</data>
<data name="txtUserdirect.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@@ -865,13 +793,13 @@
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage4.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 460</value>
<value>610, 420</value>
</data>
<data name="tabPage4.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="tabPage4.Text" xml:space="preserve">
<value>2.Direct Domain or IP</value>
<value>Directly connected Domain or IP</value>
</data>
<data name="&gt;&gt;tabPage4.Name" xml:space="preserve">
<value>tabPage4</value>
@@ -891,9 +819,6 @@
<data name="txtUserblock.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="txtUserblock.MaxLength" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="txtUserblock.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@@ -901,7 +826,7 @@
<value>Vertical</value>
</data>
<data name="txtUserblock.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 454</value>
<value>604, 414</value>
</data>
<data name="txtUserblock.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@@ -925,13 +850,13 @@
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage5.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 460</value>
<value>610, 420</value>
</data>
<data name="tabPage5.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="tabPage5.Text" xml:space="preserve">
<value>3.Block Domain or IP</value>
<value>Blocked Domain or IP</value>
</data>
<data name="&gt;&gt;tabPage5.Name" xml:space="preserve">
<value>tabPage5</value>
@@ -945,74 +870,14 @@
<data name="&gt;&gt;tabPage5.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="cmbroutingMode.Items" xml:space="preserve">
<value>Global</value>
</data>
<data name="cmbroutingMode.Items1" xml:space="preserve">
<value>Bypassing the LAN address</value>
</data>
<data name="cmbroutingMode.Items2" xml:space="preserve">
<value>Bypass mainland address</value>
</data>
<data name="cmbroutingMode.Items3" xml:space="preserve">
<value>Bypassing LAN and mainland address</value>
</data>
<data name="cmbroutingMode.Location" type="System.Drawing.Point, System.Drawing">
<value>21, 17</value>
</data>
<data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing">
<value>255, 20</value>
</data>
<data name="cmbroutingMode.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="&gt;&gt;cmbroutingMode.Name" xml:space="preserve">
<value>cmbroutingMode</value>
</data>
<data name="&gt;&gt;cmbroutingMode.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbroutingMode.Parent" xml:space="preserve">
<value>tabPage8</value>
</data>
<data name="&gt;&gt;cmbroutingMode.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tabPage8.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
</data>
<data name="tabPage8.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage8.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 460</value>
</data>
<data name="tabPage8.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="tabPage8.Text" xml:space="preserve">
<value>4.Pre-defined rules</value>
</data>
<data name="&gt;&gt;tabPage8.Name" xml:space="preserve">
<value>tabPage8</value>
</data>
<data name="&gt;&gt;tabPage8.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tabPage8.Parent" xml:space="preserve">
<value>tabControl2</value>
</data>
<data name="&gt;&gt;tabPage8.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="tabControl2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 84</value>
<value>3, 124</value>
</data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value>642, 486</value>
<value>618, 446</value>
</data>
<data name="tabControl2.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
@@ -1030,7 +895,7 @@
<value>0</value>
</data>
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
<value>322, 10</value>
<value>356, 43</value>
</data>
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>229, 23</value>
@@ -1053,8 +918,38 @@
<data name="&gt;&gt;btnSetDefRountingRule.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="cmbdomainStrategy.Items" xml:space="preserve">
<value>AsIs</value>
</data>
<data name="cmbdomainStrategy.Items1" xml:space="preserve">
<value>IPIfNonMatch</value>
</data>
<data name="cmbdomainStrategy.Items2" xml:space="preserve">
<value>IPOnDemand</value>
</data>
<data name="cmbdomainStrategy.Location" type="System.Drawing.Point, System.Drawing">
<value>123, 13</value>
</data>
<data name="cmbdomainStrategy.Size" type="System.Drawing.Size, System.Drawing">
<value>209, 20</value>
</data>
<data name="cmbdomainStrategy.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.Name" xml:space="preserve">
<value>cmbdomainStrategy</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 45</value>
<value>5, 83</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>598, 16</value>
@@ -1075,36 +970,6 @@
<value>panel3</value>
</data>
<data name="&gt;&gt;labRoutingTips.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="cmbdomainStrategy.Items" xml:space="preserve">
<value>AsIs</value>
</data>
<data name="cmbdomainStrategy.Items1" xml:space="preserve">
<value>IPIfNonMatch</value>
</data>
<data name="cmbdomainStrategy.Items2" xml:space="preserve">
<value>IPOnDemand</value>
</data>
<data name="cmbdomainStrategy.Location" type="System.Drawing.Point, System.Drawing">
<value>115, 10</value>
</data>
<data name="cmbdomainStrategy.Size" type="System.Drawing.Size, System.Drawing">
<value>165, 20</value>
</data>
<data name="cmbdomainStrategy.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.Name" xml:space="preserve">
<value>cmbdomainStrategy</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;cmbdomainStrategy.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label15.AutoSize" type="System.Boolean, mscorlib">
@@ -1114,7 +979,7 @@
<value>NoControl</value>
</data>
<data name="label15.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 14</value>
<value>13, 17</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
@@ -1137,6 +1002,69 @@
<data name="&gt;&gt;label15.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label12.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label12.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 50</value>
</data>
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
</data>
<data name="label12.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="label12.Text" xml:space="preserve">
<value>Routing mode</value>
</data>
<data name="&gt;&gt;label12.Name" xml:space="preserve">
<value>label12</value>
</data>
<data name="&gt;&gt;label12.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label12.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="cmbroutingMode.Items" xml:space="preserve">
<value>Global</value>
</data>
<data name="cmbroutingMode.Items1" xml:space="preserve">
<value>Bypassing the LAN address</value>
</data>
<data name="cmbroutingMode.Items2" xml:space="preserve">
<value>Bypass mainland address</value>
</data>
<data name="cmbroutingMode.Items3" xml:space="preserve">
<value>Bypassing LAN and mainland address</value>
</data>
<data name="cmbroutingMode.Location" type="System.Drawing.Point, System.Drawing">
<value>123, 46</value>
</data>
<data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing">
<value>209, 20</value>
</data>
<data name="cmbroutingMode.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="&gt;&gt;cmbroutingMode.Name" xml:space="preserve">
<value>cmbroutingMode</value>
</data>
<data name="&gt;&gt;cmbroutingMode.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbroutingMode.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;cmbroutingMode.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
@@ -1144,7 +1072,7 @@
<value>3, 17</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>642, 67</value>
<value>618, 107</value>
</data>
<data name="panel3.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
@@ -1168,7 +1096,7 @@
<value>3, 3</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>648, 573</value>
<value>624, 573</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
@@ -1192,7 +1120,7 @@
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 579</value>
<value>630, 579</value>
</data>
<data name="tabPage2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@@ -1534,7 +1462,7 @@
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 579</value>
<value>630, 579</value>
</data>
<data name="tabPage6.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@@ -1555,7 +1483,7 @@
<value>2</value>
</data>
<data name="cbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
<value>161, 84</value>
<value>161, 82</value>
</data>
<data name="cbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 20</value>
@@ -1575,6 +1503,27 @@
<data name="&gt;&gt;cbFreshrate.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tbCacheDays.Location" type="System.Drawing.Point, System.Drawing">
<value>516, 109</value>
</data>
<data name="tbCacheDays.Size" type="System.Drawing.Size, System.Drawing">
<value>60, 21</value>
</data>
<data name="tbCacheDays.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="&gt;&gt;tbCacheDays.Name" xml:space="preserve">
<value>tbCacheDays</value>
</data>
<data name="&gt;&gt;tbCacheDays.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tbCacheDays.Parent" xml:space="preserve">
<value>tabPage7</value>
</data>
<data name="&gt;&gt;tbCacheDays.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="lbFreshrate.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@@ -1582,7 +1531,7 @@
<value>NoControl</value>
</data>
<data name="lbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
<value>30, 92</value>
<value>30, 90</value>
</data>
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
<value>125, 12</value>
@@ -1603,7 +1552,34 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;lbFreshrate.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="lbCacheDays.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lbCacheDays.Location" type="System.Drawing.Point, System.Drawing">
<value>30, 118</value>
</data>
<data name="lbCacheDays.Size" type="System.Drawing.Size, System.Drawing">
<value>455, 12</value>
</data>
<data name="lbCacheDays.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
</data>
<data name="lbCacheDays.Text" xml:space="preserve">
<value>Cache days(between 0 to 30, 0 disable cache indivitual days statistic data)</value>
</data>
<data name="&gt;&gt;lbCacheDays.Name" xml:space="preserve">
<value>lbCacheDays</value>
</data>
<data name="&gt;&gt;lbCacheDays.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lbCacheDays.Parent" xml:space="preserve">
<value>tabPage7</value>
</data>
<data name="&gt;&gt;lbCacheDays.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="chkEnableStatistics.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -1612,7 +1588,7 @@
<value>NoControl</value>
</data>
<data name="chkEnableStatistics.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 62</value>
<value>15, 60</value>
</data>
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>558, 16</value>
@@ -1633,7 +1609,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;chkEnableStatistics.ZOrder" xml:space="preserve">
<value>2</value>
<value>4</value>
</data>
<data name="chkAllowLANConn.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -1660,7 +1636,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;chkAllowLANConn.ZOrder" xml:space="preserve">
<value>3</value>
<value>5</value>
</data>
<data name="txturlGFWList.Location" type="System.Drawing.Point, System.Drawing">
<value>32, 205</value>
@@ -1681,7 +1657,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;txturlGFWList.ZOrder" xml:space="preserve">
<value>4</value>
<value>6</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -1708,7 +1684,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>5</value>
<value>7</value>
</data>
<data name="chkAutoRun.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -1735,7 +1711,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;chkAutoRun.ZOrder" xml:space="preserve">
<value>6</value>
<value>8</value>
</data>
<data name="tabPage7.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
@@ -1744,7 +1720,7 @@
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage7.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 579</value>
<value>630, 579</value>
</data>
<data name="tabPage7.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@@ -1771,7 +1747,7 @@
<value>0, 10</value>
</data>
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 605</value>
<value>638, 605</value>
</data>
<data name="tabControl1.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
@@ -1819,7 +1795,7 @@
<value>0, 615</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 60</value>
<value>638, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
@@ -1843,7 +1819,7 @@
<value>0, 0</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 10</value>
<value>638, 10</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
@@ -1860,6 +1836,9 @@
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<metadata name="configBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -1867,7 +1846,7 @@
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>662, 675</value>
<value>638, 675</value>
</data>
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
@@ -1875,6 +1854,12 @@
<data name="$this.Text" xml:space="preserve">
<value>Settings</value>
</data>
<data name="&gt;&gt;configBindingSource.Name" xml:space="preserve">
<value>configBindingSource</value>
</data>
<data name="&gt;&gt;configBindingSource.Type" xml:space="preserve">
<value>System.Windows.Forms.BindingSource, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>OptionSettingForm</value>
</data>
@@ -120,31 +120,7 @@
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label16.Text" xml:space="preserve">
<value>Http代理</value>
</data>
<data name="cmblistenerType.Items" xml:space="preserve">
<value>关闭Http代理</value>
</data>
<data name="cmblistenerType.Items1" xml:space="preserve">
<value>开启Http代理,并自动配置代理服务器(全局模式)</value>
</data>
<data name="cmblistenerType.Items2" xml:space="preserve">
<value>开启PAC,并自动配置PAC(PAC模式)</value>
</data>
<data name="cmblistenerType.Items3" xml:space="preserve">
<value>仅开启Http代理,不自动配置代理服务器(直连模式)</value>
</data>
<data name="cmblistenerType.Items4" xml:space="preserve">
<value>仅开启PAC,不自动配置PAC</value>
</data>
<data name="chksniffingEnabled2.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 16</value>
</data>
@@ -214,47 +190,55 @@
<data name="label2.Text" xml:space="preserve">
<value>本地监听端口</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value> Core:路由设置 </value>
</data>
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 89</value>
</data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value>642, 481</value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value> 1.代理的Domain或IP </value>
</data>
<data name="txtUseragent.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
</data>
<data name="tabPage4.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
<value> 代理的Domain或IP </value>
</data>
<data name="tabPage4.Text" xml:space="preserve">
<value> 2.直连的Domain或IP </value>
</data>
<data name="txtUserdirect.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
</data>
<data name="tabPage5.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
<value> 直连的Domain或IP </value>
</data>
<data name="tabPage5.Text" xml:space="preserve">
<value> 3.阻止的Domain或IP </value>
<value> 阻止的Domain或IP </value>
</data>
<data name="txtUserblock.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnSetDefRountingRule.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="tabPage8.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
<value>381, 43</value>
</data>
<data name="tabPage8.Text" xml:space="preserve">
<value> 4.预定义规则 </value>
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>201, 23</value>
</data>
<data name="btnSetDefRountingRule.Text" xml:space="preserve">
<value>一键设置默认自定义路由规则</value>
</data>
<data name="cmbdomainStrategy.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 20</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>383, 12</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>域名策略</value>
</data>
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label12.Text" xml:space="preserve">
<value>路由模式</value>
</data>
<data name="cmbroutingMode.Items" xml:space="preserve">
<value>全局</value>
@@ -268,77 +252,15 @@
<data name="cmbroutingMode.Items3" xml:space="preserve">
<value>绕过局域网及大陆地址</value>
</data>
<data name="cmbroutingMode.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 26</value>
</data>
<data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing">
<value>244, 20</value>
<value>232, 20</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>642, 72</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnSetDefRountingRule.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
<value>351, 14</value>
</data>
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>201, 23</value>
</data>
<data name="btnSetDefRountingRule.Text" xml:space="preserve">
<value>一键设置默认自定义路由规则</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 49</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>383, 12</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value>
</data>
<data name="cmbdomainStrategy.Location" type="System.Drawing.Point, System.Drawing">
<value>81, 14</value>
</data>
<data name="cmbdomainStrategy.Size" type="System.Drawing.Size, System.Drawing">
<value>186, 20</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>域名策略</value>
<data name="tabPage2.Text" xml:space="preserve">
<value> Core:路由设置 </value>
</data>
<data name="tabPage6.Text" xml:space="preserve">
<value> Core:KCP设置 </value>
</data>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
</data>
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
</data>
<data name="lbFreshrate.Text" xml:space="preserve">
<value>统计刷新频率</value>
</data>
<data name="lbCacheDays.Size" type="System.Drawing.Size, System.Drawing">
<value>305, 12</value>
</data>
<data name="lbCacheDays.Text" xml:space="preserve">
<value>缓存天数(0-30, 0关闭缓存单独每天的数据使用情况)</value>
</data>
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>384, 16</value>
</data>
<data name="chkEnableStatistics.Text" xml:space="preserve">
<value>启用统计(实时网速显示和使用流量显示,需要重启v2rayN客户端)</value>
</data>
<data name="chkAllowLANConn.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 16</value>
</data>
@@ -357,10 +279,22 @@
<data name="chkAutoRun.Text" xml:space="preserve">
<value>开机自动启动(可能会不成功)</value>
</data>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>参数设置</value>
</data>
<data name="chkEnableStatistics.Text" xml:space="preserve">
<value>启用统计(实时网速显示和使用流量显示,需要重启v2rayN客户端)</value>
</data>
<data name="lbCacheDays.Text" xml:space="preserve">
<value>缓存天数(0-30, 0关闭缓存单独每天的数据使用情况)</value>
</data>
<data name="lbFreshrate.Text" xml:space="preserve">
<value>统计刷新频率</value>
</data>
</root>
-1
View File
@@ -1,6 +1,5 @@
using System;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Forms
+27 -46
View File
@@ -5,28 +5,29 @@ namespace v2rayN
{
#region 常量
/// <summary>
/// 更新链接
/// </summary>
public const string UpdateUrl = @"https://github.com/2dust/v2rayN/releases";
/// <summary>
/// 关于链接
/// </summary>
public const string AboutUrl = @"https://github.com/2dust/v2rayN";
public const string UpdateUrl = AboutUrl + @"/releases";
/// <summary>
/// SpeedTestUrl
/// </summary>
public const string SpeedTestUrl = @"http://speedtest-sgp1.digitalocean.com/10mb.test";
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
public const string SpeedTestUrl = @"http://speedtest-sfo2.digitalocean.com/10mb.test";
/// <summary>
/// CustomRoutingListUrl
/// </summary>
public const string CustomRoutingListUrl = @"https://raw.githubusercontent.com/2dust/v2rayCustomRoutingList/master/";
public const string GFWLIST_URL = "https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt";
/// <summary>
/// PromotionUrl
/// </summary>
public const string PromotionUrl = @"aHR0cHM6Ly8xLjIzNDQ1Ni54eXovYWRzLmh0bWw=";
public const string PromotionUrl = @"https://1.2345345.xyz/ads.html";
/// <summary>
/// 本软件配置文件名
@@ -59,8 +60,6 @@ namespace v2rayN
/// </summary>
public const string BlankPacFileName = "v2rayN.Sample.BlankPac.txt";
public const string CustomRoutingFileName = "v2rayN.Sample.custom_routing_";
/// <summary>
/// 默认加密方式
@@ -96,19 +95,12 @@ namespace v2rayN
/// 阻止 tag值
/// </summary>
public const string blockTag = "block";
/// <summary>
///
/// </summary>
public const string StreamSecurity = "tls";
public const string InboundSocks = "socks";
public const string InboundHttp = "http";
public const string Loopback = "127.0.0.1";
public const string InboundAPITagName = "api";
public const string InboundAPIProtocal = "dokodemo-door";
/// <summary>
/// vmess
/// </summary>
@@ -154,13 +146,20 @@ namespace v2rayN
/// </summary>
public const string CustomIconName = "v2rayN.ico";
public const string InboundAPITagName = "api";
public const string InboundProxyTagName = "proxy";
public const string Loopback = "127.0.0.1";
public const string InboundAPIProtocal = "dokodemo-door";
public enum StatisticsFreshRate
{
quick = 1000,
medium = 2000,
slow = 3000
}
public const string StatisticLogOverall = "StatisticLogOverall.json";
public const string StatisticLogDirectory = "Statistics";
public const string StatisticLogOverall = "overall.txt";
#endregion
@@ -169,50 +168,32 @@ namespace v2rayN
/// <summary>
/// 是否需要重启服务V2ray
/// </summary>
public static bool reloadV2ray
{
get; set;
}
public static bool reloadV2ray { get; set; }
/// <summary>
/// 是否开启全局代理(http)
/// </summary>
public static bool sysAgent
{
get; set;
}
public static bool sysAgent { get; set; }
/// <summary>
/// socks端口
/// socks端口号
/// </summary>
public static int socksPort
{
get; set;
}
public static int socksPort { get; set; }
/// <summary>
/// http端口
/// 全局代理端口(http)
/// </summary>
public static int httpPort
{
get; set;
}
public static int sysAgentPort { get; set; }
/// <summary>
/// PAC端口
/// PAC监听端口号
/// </summary>
public static int pacPort
{
get; set;
}
public static int pacPort { get; set; }
/// <summary>
///
/// </summary>
public static int statePort
{
get; set;
}
public static int statePort { get; set; }
#endregion
+12 -18
View File
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Net;
using v2rayN.Mode;
using v2rayN.Base;
namespace v2rayN.Handler
{
@@ -41,7 +40,10 @@ namespace v2rayN.Handler
////默认监听端口
//config.pacPort = 8888;
// 默认缓存七天
config.CacheDays = 7;
// 默认不开启统计
config.enableStatistics = false;
@@ -54,7 +56,7 @@ namespace v2rayN.Handler
{
config.inbound = new List<InItem>();
InItem inItem = new InItem();
inItem.protocol = Global.InboundSocks;
inItem.protocol = "socks";
inItem.localPort = 10808;
inItem.udpEnabled = true;
inItem.sniffingEnabled = true;
@@ -73,7 +75,7 @@ namespace v2rayN.Handler
//http协议不由core提供,只保留socks
if (config.inbound.Count > 0)
{
config.inbound[0].protocol = Global.InboundSocks;
config.inbound[0].protocol = "socks";
}
}
//路由规则
@@ -118,14 +120,6 @@ namespace v2rayN.Handler
//{
// config.pacPort = 8888;
//}
if (Utils.IsNullOrEmpty(config.urlGFWList))
{
config.urlGFWList = Global.GFWLIST_URL;
}
//if (Utils.IsNullOrEmpty(config.remoteDNS))
//{
// config.remoteDNS = "1.1.1.1";
//}
if (config.subItem == null)
{
@@ -308,9 +302,9 @@ namespace v2rayN.Handler
/// </summary>
/// <param name="config"></param>
/// <returns></returns>
public static int SaveConfig(ref Config config, bool reload = true)
public static int SaveConfig(ref Config config)
{
Global.reloadV2ray = reload;
Global.reloadV2ray = true;
ToJsonFile(config);
@@ -321,7 +315,7 @@ namespace v2rayN.Handler
/// 存储文件
/// </summary>
/// <param name="config"></param>
private static void ToJsonFile(Config config)
public static void ToJsonFile(Config config)
{
Utils.ToJsonFile(config, Utils.GetPath(configRes));
}
@@ -520,11 +514,11 @@ namespace v2rayN.Handler
{
string newFileName = string.Empty;
newFileName = string.Format("{0}.json", Utils.GetGUID());
//newFileName = Path.Combine(Utils.GetTempPath(), newFileName);
newFileName = Path.Combine(Utils.GetTempPath(), newFileName);
try
{
File.Copy(fileName, Path.Combine(Utils.GetTempPath(), newFileName));
File.Copy(fileName, newFileName);
}
catch
{
@@ -584,7 +578,7 @@ namespace v2rayN.Handler
vmessItem.address = vmessItem.address.TrimEx();
vmessItem.id = vmessItem.id.TrimEx();
vmessItem.security = vmessItem.security.TrimEx();
if (index >= 0)
{
//修改
-155
View File
@@ -1,155 +0,0 @@
using Grpc.Core;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
{
class MainFormHandler
{
private static MainFormHandler instance;
//private DownloadHandle downloadHandle2;
//private Config _config;
//private V2rayHandler _v2rayHandler;
//private List<int> _selecteds;
//private Thread _workThread;
//Action<int, string> _updateFunc;
public static MainFormHandler Instance
{
get
{
if (instance == null)
{
instance = new MainFormHandler();
}
return instance;
}
}
public Icon GetNotifyIcon(Config config, Icon def)
{
try
{
var color = ColorTranslator.FromHtml("#3399CC");
var index = config.listenerType;
if (index > 0)
{
color = (new Color[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange })[index - 1];
//color = ColorTranslator.FromHtml(new string[] { "#CC0066", "#CC6600", "#99CC99", "#666699" }[index - 1]);
}
var width = 128;
var height = 128;
var bitmap = new Bitmap(width, height);
var graphics = Graphics.FromImage(bitmap);
var drawBrush = new SolidBrush(color);
graphics.FillEllipse(drawBrush, new Rectangle(0, 0, width, height));
var zoom = 16;
graphics.DrawImage(new Bitmap(Properties.Resources.notify, width - zoom, width - zoom), zoom / 2, zoom / 2);
Icon createdIcon = Icon.FromHandle(bitmap.GetHicon());
drawBrush.Dispose();
graphics.Dispose();
bitmap.Dispose();
return createdIcon;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return def;
}
}
public void Export2ClientConfig(int index, Config config)
{
//int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
if (config.vmess[index].configType != (int)EConfigType.Vmess)
{
UI.Show(UIRes.I18N("NonVmessService"));
return;
}
SaveFileDialog fileDialog = new SaveFileDialog();
fileDialog.Filter = "Config|*.json";
fileDialog.FilterIndex = 2;
fileDialog.RestoreDirectory = true;
if (fileDialog.ShowDialog() != DialogResult.OK)
{
return;
}
string fileName = fileDialog.FileName;
if (Utils.IsNullOrEmpty(fileName))
{
return;
}
Config configCopy = Utils.DeepCopy<Config>(config);
configCopy.index = index;
string msg;
if (V2rayConfigHandler.Export2ClientConfig(configCopy, fileName, out msg) != 0)
{
UI.Show(msg);
}
else
{
UI.Show(string.Format(UIRes.I18N("SaveClientConfigurationIn"), fileName));
}
}
public void Export2ServerConfig(int index, Config config)
{
//int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
if (config.vmess[index].configType != (int)EConfigType.Vmess)
{
UI.Show(UIRes.I18N("NonVmessService"));
return;
}
SaveFileDialog fileDialog = new SaveFileDialog();
fileDialog.Filter = "Config|*.json";
fileDialog.FilterIndex = 2;
fileDialog.RestoreDirectory = true;
if (fileDialog.ShowDialog() != DialogResult.OK)
{
return;
}
string fileName = fileDialog.FileName;
if (Utils.IsNullOrEmpty(fileName))
{
return;
}
Config configCopy = Utils.DeepCopy<Config>(config);
configCopy.index = index;
string msg;
if (V2rayConfigHandler.Export2ServerConfig(configCopy, fileName, out msg) != 0)
{
UI.Show(msg);
}
else
{
UI.Show(string.Format(UIRes.I18N("SaveServerConfigurationIn"), fileName));
}
}
}
}
-311
View File
@@ -1,311 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using v2rayN.Mode;
namespace v2rayN.Handler
{
class SpeedtestHandler
{
private DownloadHandle downloadHandle2;
private Config _config;
private V2rayHandler _v2rayHandler;
private List<int> _selecteds;
private Thread _workThread;
Action<int, string> _updateFunc;
private int testCounter = 0;
private int ItemIndex
{
get
{
return _selecteds[testCounter - 1];
}
}
public SpeedtestHandler(ref Config config, ref V2rayHandler v2rayHandler, List<int> selecteds, string actionType, Action<int, string> update)
{
_config = config;
_v2rayHandler = v2rayHandler;
_selecteds = selecteds;
_updateFunc = update;
if (actionType == "ping")
{
_workThread = new Thread(new ThreadStart(RunPing));
_workThread.IsBackground = true;
_workThread.Start();
}
if (actionType == "tcping")
{
_workThread = new Thread(new ThreadStart(RunTcping));
_workThread.IsBackground = true;
_workThread.Start();
}
else if (actionType == "realping")
{
_workThread = new Thread(new ThreadStart(RunRealPing));
_workThread.IsBackground = true;
_workThread.Start();
}
else if (actionType == "speedtest")
{
RunSpeedTest();
}
}
public void Close()
{
try
{
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private void RunPing()
{
try
{
for (int k = 0; k < _selecteds.Count; k++)
{
int index = _selecteds[k];
if (_config.vmess[index].configType == (int)EConfigType.Custom)
{
continue;
}
try
{
long time = Utils.Ping(_config.vmess[index].address);
_updateFunc(index, string.Format("{0}ms", time));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
Thread.Sleep(100);
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private void RunTcping()
{
try
{
for (int k = 0; k < _selecteds.Count; k++)
{
int index = _selecteds[k];
if (_config.vmess[index].configType == (int)EConfigType.Custom)
{
continue;
}
try
{
var time = GetTcpingTime(_config.vmess[index].address, _config.vmess[index].port);
_updateFunc(index, string.Format("{0}ms", time));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
Thread.Sleep(100);
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private void RunRealPing()
{
try
{
string msg = string.Empty;
Global.reloadV2ray = true;
_v2rayHandler.LoadV2ray(_config, _selecteds);
Thread.Sleep(5000);
var httpPort = _config.GetLocalPort("speedtest");
for (int k = 0; k < _selecteds.Count; k++)
{
int index = _selecteds[k];
if (_config.vmess[index].configType == (int)EConfigType.Custom)
{
continue;
}
try
{
var webProxy = new WebProxy(Global.Loopback, httpPort + index);
int responseTime = -1;
var status = GetRealPingTime(Global.SpeedPingTestUrl, webProxy, out responseTime);
if (!Utils.IsNullOrEmpty(status))
{
_updateFunc(index, string.Format("{0}", status));
}
else
{
_updateFunc(index, string.Format("{0}ms", responseTime));
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
Thread.Sleep(100);
}
Global.reloadV2ray = true;
_v2rayHandler.LoadV2ray(_config);
Thread.Sleep(100);
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private void RunSpeedTest()
{
if (_config.vmess.Count <= 0)
{
return;
}
Global.reloadV2ray = true;
_v2rayHandler.LoadV2ray(_config, _selecteds);
Thread.Sleep(5000);
string url = Global.SpeedTestUrl;
testCounter = 0;
if (downloadHandle2 == null)
{
downloadHandle2 = new DownloadHandle();
downloadHandle2.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
_updateFunc(ItemIndex, args.Msg);
if (ServerSpeedTestSub(testCounter, url) != 0)
{
return;
}
}
else
{
_updateFunc(ItemIndex, args.Msg);
}
};
downloadHandle2.Error += (sender2, args) =>
{
_updateFunc(ItemIndex, args.GetException().Message);
if (ServerSpeedTestSub(testCounter, url) != 0)
{
return;
}
};
}
if (ServerSpeedTestSub(testCounter, url) != 0)
{
return;
}
}
private int ServerSpeedTestSub(int index, string url)
{
if (index >= _selecteds.Count)
{
Global.reloadV2ray = true;
_v2rayHandler.LoadV2ray(_config);
return -1;
}
var httpPort = _config.GetLocalPort("speedtest");
index = _selecteds[index];
testCounter++;
var webProxy = new WebProxy(Global.Loopback, httpPort + index);
downloadHandle2.DownloadFileAsync(_config, url, webProxy, 30);
return 0;
}
private int GetTcpingTime(string url, int port)
{
var responseTime = -1;
try
{
IPHostEntry ipHostInfo = System.Net.Dns.GetHostEntry(url);
IPAddress ipAddress = ipHostInfo.AddressList[0];
var timer = new Stopwatch();
timer.Start();
Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
clientSocket.Connect(new IPEndPoint(ipAddress, port));
timer.Stop();
responseTime = timer.Elapsed.Milliseconds;
clientSocket.Close();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
return responseTime;
}
private string GetRealPingTime(string url, WebProxy webProxy, out int responseTime)
{
string msg = string.Empty;
responseTime = -1;
try
{
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
myHttpWebRequest.Timeout = 5000;
myHttpWebRequest.Proxy = webProxy;//new WebProxy(Global.Loopback, Global.httpPort);
var timer = new Stopwatch();
timer.Start();
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
if (myHttpWebResponse.StatusCode != HttpStatusCode.OK
&& myHttpWebResponse.StatusCode != HttpStatusCode.NoContent)
{
msg = myHttpWebResponse.StatusDescription;
}
timer.Stop();
responseTime = timer.Elapsed.Milliseconds;
myHttpWebResponse.Close();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
msg = ex.Message;
}
return msg;
}
}
}
+264 -127
View File
@@ -6,72 +6,65 @@ using System.Net;
using System.Net.Sockets;
using System.Threading;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.Protos.Statistics;
using v2rayN.Tool;
namespace v2rayN.Handler
{
class StatisticsHandler
{
private Mode.Config config_;
private ServerStatistics serverStatistics_;
private Channel channel_;
private StatsService.StatsServiceClient client_;
private Thread workThread_;
private bool exitFlag_;
Action<ulong, ulong, List<ServerStatItem>> updateFunc_;
Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> updateFunc_;
private bool enabled_;
public bool Enable
{
get; set;
get { return enabled_; }
set { enabled_ = value; }
}
public bool UpdateUI
public bool UpdateUI;
public ulong TotalUp { get; private set; }
public ulong TotalDown { get; private set; }
public List<Mode.ServerStatistics> Statistic { get; set; }
public ulong Up { get; private set; }
public ulong Down { get; private set; }
private string logPath_;
private bool exitFlag_; // true to close workThread_
public StatisticsHandler(Mode.Config config, Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> update)
{
get; set;
}
public List<ServerStatItem> Statistic
{
get
{
return serverStatistics_.server;
}
}
public StatisticsHandler(Mode.Config config, Action<ulong, ulong, List<ServerStatItem>> update)
{
try
{
if (Environment.Is64BitOperatingSystem)
{
FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x64.dll"), Resources.grpc_csharp_ext_x64_dll);
}
else
{
FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x86.dll"), Resources.grpc_csharp_ext_x86_dll);
}
}
catch (IOException ex)
{
Utils.SaveLog(ex.Message, ex);
}
config_ = config;
Enable = config.enableStatistics;
enabled_ = config.enableStatistics;
UpdateUI = false;
updateFunc_ = update;
logPath_ = Utils.GetPath($"{Global.StatisticLogDirectory}\\");
Statistic = new List<Mode.ServerStatistics>();
exitFlag_ = false;
DeleteExpiredLog();
foreach (var server in config.vmess)
{
var statistic = new ServerStatistics(server.remarks, server.address, server.port, server.path, server.requestHost, 0, 0, 0, 0);
Statistic.Add(statistic);
}
LoadFromFile();
GrpcInit();
workThread_ = new Thread(new ThreadStart(Run));
workThread_.IsBackground = true;
workThread_.Start();
}
@@ -81,7 +74,7 @@ namespace v2rayN.Handler
{
Global.statePort = GetFreePort();
channel_ = new Channel($"{Global.Loopback}:{Global.statePort}", ChannelCredentials.Insecure);
channel_ = new Channel($"127.0.0.1:{Global.statePort}", ChannelCredentials.Insecure);
channel_.ConnectAsync();
client_ = new StatsService.StatsServiceClient(channel_);
}
@@ -91,6 +84,7 @@ namespace v2rayN.Handler
{
try
{
exitFlag_ = true;
channel_.ShutdownAsync();
}
@@ -106,7 +100,7 @@ namespace v2rayN.Handler
{
try
{
if (Enable && channel_.State == ChannelState.Ready)
if (enabled_ && channel_.State == ChannelState.Ready)
{
QueryStatsResponse res = null;
try
@@ -120,23 +114,32 @@ namespace v2rayN.Handler
if (res != null)
{
var itemId = config_.getItemId();
var serverStatItem = GetServerStatItem(itemId);
var addr = config_.address();
var port = config_.port();
var path = config_.path();
var cur = Statistic.FindIndex(item => item.address == addr && item.port == port && item.path == path);
ulong up = 0,
down = 0;
//TODO: parse output
ParseOutput(res.Stat, out up, out down);
serverStatItem.todayUp += up;
serverStatItem.todayDown += down;
serverStatItem.totalUp += up;
serverStatItem.totalDown += down;
Up = up;
Down = down;
TotalUp += up;
TotalDown += down;
if (cur != -1)
{
Statistic[cur].todayUp += up;
Statistic[cur].todayDown += down;
Statistic[cur].totalUp += up;
Statistic[cur].totalDown += down;
}
if (UpdateUI)
{
updateFunc_(up, down, new List<ServerStatItem> { serverStatItem });
}
updateFunc_(TotalUp, TotalDown, Up, Down, Statistic);
}
}
Thread.Sleep(config_.statisticsFreshRate);
@@ -149,82 +152,7 @@ namespace v2rayN.Handler
}
}
public void LoadFromFile()
{
try
{
string result = Utils.LoadResource(Utils.GetPath(Global.StatisticLogOverall));
if (!Utils.IsNullOrEmpty(result))
{
//转成Json
serverStatistics_ = Utils.FromJson<ServerStatistics>(result);
}
if (serverStatistics_ == null)
{
serverStatistics_ = new ServerStatistics();
}
if (serverStatistics_.server == null)
{
serverStatistics_.server = new List<ServerStatItem>();
}
var ticks = DateTime.Now.Date.Ticks;
foreach (var item in serverStatistics_.server)
{
if (item.dateNow != ticks)
{
item.todayUp = 0;
item.todayDown = 0;
item.dateNow = ticks;
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
public void SaveToFile()
{
try
{
Utils.ToJsonFile(serverStatistics_, Utils.GetPath(Global.StatisticLogOverall));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private ServerStatItem GetServerStatItem(string itemId)
{
var ticks = DateTime.Now.Date.Ticks;
var cur = Statistic.FindIndex(item => item.itemId == itemId);
if (cur < 0)
{
Statistic.Add(new ServerStatItem
{
itemId = itemId,
totalUp = 0,
totalDown = 0,
todayUp = 0,
todayDown = 0,
dateNow = ticks
});
cur = Statistic.Count - 1;
}
if (Statistic[cur].dateNow != ticks)
{
Statistic[cur].todayUp = 0;
Statistic[cur].todayDown = 0;
Statistic[cur].dateNow = ticks;
}
return Statistic[cur];
}
private void ParseOutput(Google.Protobuf.Collections.RepeatedField<Stat> source, out ulong up, out ulong down)
public void ParseOutput(Google.Protobuf.Collections.RepeatedField<Stat> source, out ulong up, out ulong down)
{
up = 0; down = 0;
@@ -243,7 +171,7 @@ namespace v2rayN.Handler
name = nStr[1];
type = nStr[3];
if (name == Global.agentTag)
if (name == Global.InboundProxyTagName)
{
if (type == "uplink")
{
@@ -262,6 +190,215 @@ namespace v2rayN.Handler
}
}
public void SaveToFile()
{
if (!Directory.Exists(logPath_))
{
Directory.CreateDirectory(logPath_);
}
// 总流量统计文件
var overallPath = Path.Combine(logPath_, Global.StatisticLogOverall);
if (!File.Exists(overallPath))
{
File.Create(overallPath);
}
try
{
using (var overallWriter = new StreamWriter(overallPath))
{
double up_amount, down_amount;
string up_unit, down_unit;
Utils.ToHumanReadable(TotalUp, out up_amount, out up_unit);
Utils.ToHumanReadable(TotalDown, out down_amount, out down_unit);
overallWriter.WriteLine($"LastUpdate {DateTime.Now.ToLongDateString()} {DateTime.Now.ToLongTimeString()}");
overallWriter.WriteLine($"UP {string.Format("{0:f2}", up_amount)}{up_unit} {TotalUp}");
overallWriter.WriteLine($"DOWN {string.Format("{0:f2}", down_amount)}{down_unit} {TotalDown}");
foreach (var s in Statistic)
{
overallWriter.WriteLine($"* {s.name} {s.address} {s.port} {s.path} {s.host} {s.totalUp} {s.totalDown}");
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
// 当天流量记录文件
var dailyPath = Path.Combine(logPath_, $"{DateTime.Now.ToLongDateString()}.txt");
if (!File.Exists(dailyPath))
{
File.Create(dailyPath);
}
try
{
using (var dailyWriter = new StreamWriter(dailyPath))
{
dailyWriter.WriteLine($"LastUpdate {DateTime.Now.ToLongDateString()} {DateTime.Now.ToLongTimeString()}");
foreach (var s in Statistic)
{
dailyWriter.WriteLine($"* {s.name} {s.address} {s.port} {s.path} {s.host} {s.todayUp} {s.todayDown}");
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
public void LoadFromFile()
{
if (!Directory.Exists(logPath_)) return;
// 总流量统计文件
///
/// 文件结构
/// LastUpdate [date] [time]
/// UP [readable string] [amount]
/// DOWN [readable string] [amount]
/// 每行每个数据空格分隔
///
var overallPath = Path.Combine(logPath_, Global.StatisticLogOverall);
if (File.Exists(overallPath))
{
try
{
using (var overallReader = new StreamReader(overallPath))
{
while (!overallReader.EndOfStream)
{
var line = overallReader.ReadLine();
if (line.StartsWith("LastUpdate"))
{
}
else if (line.StartsWith("UP"))
{
var datas = line.Split(' ');
if (datas.Length < 3) return;
TotalUp = ulong.Parse(datas[2]);
}
else if (line.StartsWith("DOWN"))
{
var datas = line.Split(' ');
if (datas.Length < 3) return;
TotalDown = ulong.Parse(datas[2]);
}
else if (line.StartsWith("*"))
{
var datas = line.Split(' ');
if (datas.Length < 8) return;
var name = datas[1];
var address = datas[2];
var port = int.Parse(datas[3]);
var path = datas[4];
var host = datas[5];
var totalUp = ulong.Parse(datas[6]);
var totalDown = ulong.Parse(datas[7]);
var temp = new ServerStatistics(name, address, port, path, host, 0, 0, 0, 0);
var index = Statistic.FindIndex(item => Utils.IsIdenticalServer(item, temp));
if (index != -1)
{
Statistic[index].totalUp = totalUp;
Statistic[index].totalDown = totalDown;
}
else
{
var s = new Mode.ServerStatistics(name, address, port, path, host, totalUp, totalDown, 0, 0);
Statistic.Add(s);
}
}
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
// 当天流量记录文件
var dailyPath = Path.Combine(logPath_, $"{DateTime.Now.ToLongDateString()}.txt");
if (File.Exists(dailyPath))
{
try
{
using (var dailyReader = new StreamReader(dailyPath))
{
while (!dailyReader.EndOfStream)
{
var line = dailyReader.ReadLine();
if (line.StartsWith("LastUpdate"))
{
}
else if (line.StartsWith("*"))
{
var datas = line.Split(' ');
if (datas.Length < 8) return;
var name = datas[1];
var address = datas[2];
var port = int.Parse(datas[3]);
var path = datas[4];
var host = datas[5];
var todayUp = ulong.Parse(datas[6]);
var todayDown = ulong.Parse(datas[7]);
var temp = new ServerStatistics(name, address, port, path, host, 0, 0, 0, 0);
var index = Statistic.FindIndex(item => Utils.IsIdenticalServer(item, temp));
if (index != -1)
{
Statistic[index].todayUp = todayUp;
Statistic[index].todayDown = todayDown;
}
else
{
var s = new Mode.ServerStatistics(name, address, port, path, host, 0, 0, todayUp, todayDown);
Statistic.Add(s);
}
}
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
}
private void DeleteExpiredLog()
{
try
{
if (!Directory.Exists(logPath_)) return;
var dirInfo = new DirectoryInfo(logPath_);
var files = dirInfo.GetFiles();
foreach (var file in files)
{
if (file.Name == "overall.txt") continue;
var name = file.Name.Split('.')[0];
var ft = DateTime.Parse(name);
var ct = DateTime.Now;
var dur = ct - ft;
if (dur.Days > config_.CacheDays)
{
file.Delete();
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private int GetFreePort()
{
int defaultPort = 28123;
+6 -101
View File
@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using v2rayN.Base;
using v2rayN.Mode;
using System.Net;
using System.Text;
using System.Linq;
namespace v2rayN.Handler
{
@@ -159,7 +159,7 @@ namespace v2rayN.Handler
}
else
{
inbound.listen = Global.Loopback;
inbound.listen = "127.0.0.1";
}
//开启udp
inbound.settings.udp = config.inbound[0].udpEnabled;
@@ -655,7 +655,7 @@ namespace v2rayN.Handler
if (!v2rayConfig.routing.rules.Exists(item => { return item.outboundTag == tag; }))
{
var apiRoutingRule = new Mode.RulesItem();
apiRoutingRule.inboundTag = new List<string> { tag };
apiRoutingRule.inboundTag = tag;
apiRoutingRule.outboundTag = tag;
apiRoutingRule.type = "field";
v2rayConfig.routing.rules.Add(apiRoutingRule);
@@ -688,21 +688,11 @@ namespace v2rayN.Handler
return -1;
}
string addressFileName = config.address();
if (File.Exists(fileName))
{
File.Delete(fileName);
}
string addressFileName = config.address();
if (!File.Exists(addressFileName))
{
addressFileName = Path.Combine(Utils.GetTempPath(), addressFileName);
}
if (!File.Exists(addressFileName))
{
msg = UIRes.I18N("FailedGenDefaultConfiguration");
return -1;
}
File.Copy(addressFileName, fileName);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
@@ -1375,90 +1365,5 @@ namespace v2rayN.Handler
#endregion
#region Gen speedtest config
public static int GenerateClientSpeedtestConfig(Config config, List<int> selecteds, string fileName, out string msg)
{
msg = string.Empty;
try
{
if (config == null
|| config.index < 0
|| config.vmess.Count <= 0
|| config.index > config.vmess.Count - 1
)
{
msg = UIRes.I18N("CheckServerSettings");
return -1;
}
msg = UIRes.I18N("InitialConfiguration");
string result = Utils.GetEmbedText(SampleClient);
if (Utils.IsNullOrEmpty(result))
{
msg = UIRes.I18N("FailedGetDefaultConfiguration");
return -1;
}
V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result);
if (v2rayConfig == null)
{
msg = UIRes.I18N("FailedGenDefaultConfiguration");
return -1;
}
log(config, ref v2rayConfig, false);
//routing(config, ref v2rayConfig);
dns(config, ref v2rayConfig);
var httpPort = config.GetLocalPort("speedtest");
for (int k = 0; k < selecteds.Count; k++)
{
int index = selecteds[k];
if (config.vmess[index].configType == (int)EConfigType.Custom)
{
continue;
}
config.index = index;
var inbound = new Inbounds();
inbound.listen = Global.Loopback;
inbound.port = httpPort + index;
inbound.protocol = Global.InboundHttp;
inbound.tag = Global.InboundHttp + inbound.port.ToString();
v2rayConfig.inbounds.Add(inbound);
var v2rayConfigCopy = Utils.FromJson<V2rayConfig>(result);
outbound(config, ref v2rayConfigCopy);
v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString();
v2rayConfig.outbounds.Add(v2rayConfigCopy.outbounds[0]);
var rule = new Mode.RulesItem();
rule.inboundTag = new List<string> { inbound.tag };
rule.outboundTag = v2rayConfigCopy.outbounds[0].tag;
rule.type = "field";
v2rayConfig.routing.rules.Add(rule);
}
Utils.ToJsonFile(v2rayConfig, fileName);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
}
catch (Exception ex)
{
msg = UIRes.I18N("FailedGenDefaultConfiguration");
return -1;
}
return 0;
}
#endregion
}
}
+1 -22
View File
@@ -52,27 +52,6 @@ namespace v2rayN.Handler
}
}
/// <summary>
/// 载入V2ray
/// </summary>
public void LoadV2ray(Config config, List<int> _selecteds)
{
if (Global.reloadV2ray)
{
string msg = string.Empty;
string fileName = Utils.GetPath(v2rayConfigRes);
if (V2rayConfigHandler.GenerateClientSpeedtestConfig(config, _selecteds, fileName, out msg) != 0)
{
ShowMsg(false, msg);
}
else
{
ShowMsg(true, msg);
V2rayRestart();
}
}
}
/// <summary>
/// V2ray重启
/// </summary>
@@ -139,7 +118,7 @@ namespace v2rayN.Handler
}
}
if (Utils.IsNullOrEmpty(fileName))
{
{
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"https://github.com/v2ray/v2ray-core/releases");
ShowMsg(true, msg);
return;
@@ -1,15 +1,19 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using v2rayN.Base;
using System.Text;
using Newtonsoft.Json;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.HttpProxyHandler;
namespace v2rayN.Handler
{
/// <summary>
///Download
///Update V2ray Core
/// </summary>
class DownloadHandle
class V2rayUpdateHandle
{
public event EventHandler<ResultEventArgs> AbsoluteCompleted;
@@ -19,10 +23,7 @@ namespace v2rayN.Handler
public string DownloadFileName
{
get
{
return "v2ray-windows.zip";
}
get { return "v2ray-windows.zip"; }
}
public class ResultEventArgs : EventArgs
@@ -40,18 +41,19 @@ namespace v2rayN.Handler
private string latestUrl = "https://github.com/v2ray/v2ray-core/releases/latest";
private const string coreURL = "https://github.com/v2ray/v2ray-core/releases/download/{0}/v2ray-windows-{1}.zip";
private int progressPercentage = -1;
private bool blFirst = true;
private long totalBytesToReceive = 0;
private DateTime totalDatetime = new DateTime();
private int DownloadTimeout = -1;
public void AbsoluteV2rayCore(Config config)
{
SetSecurityProtocol();
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2
ServicePointManager.DefaultConnectionLimit = 256;
WebRequest request = WebRequest.Create(latestUrl);
request.BeginGetResponse(new AsyncCallback(OnResponseV2rayCore), request);
request.BeginGetResponse(new AsyncCallback(OnResponse), request);
}
private void OnResponseV2rayCore(IAsyncResult ar)
private void OnResponse(IAsyncResult ar)
{
try
{
@@ -85,29 +87,24 @@ namespace v2rayN.Handler
}
public void DownloadFileAsync(Config config, string url, WebProxy webProxy, int downloadTimeout)
public void DownloadFileAsync(Config config, string url)
{
try
{
SetSecurityProtocol();
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2
ServicePointManager.DefaultConnectionLimit = 256;
if (UpdateCompleted != null)
{
UpdateCompleted(this, new ResultEventArgs(false, "Downloading..."));
UpdateCompleted(this, new ResultEventArgs(false, url));
}
progressPercentage = -1;
totalBytesToReceive = 0;
WebClientEx ws = new WebClientEx();
DownloadTimeout = downloadTimeout;
if (webProxy != null)
{
ws.Proxy = webProxy;// new WebProxy(Global.Loopback, Global.httpPort);
}
ws.DownloadFileCompleted += ws_DownloadFileCompleted;
ws.DownloadProgressChanged += ws_DownloadProgressChanged;
ws.DownloadFileAsync(new Uri(url), Utils.GetPath(DownloadFileName));
ws.DownloadFileAsync(new Uri(url), Utils.GetPath(DownloadFileName));
blFirst = true;
}
catch (Exception ex)
{
@@ -120,27 +117,18 @@ namespace v2rayN.Handler
void ws_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
if (blFirst)
{
totalBytesToReceive = e.TotalBytesToReceive - e.BytesReceived;
totalDatetime = DateTime.Now;
blFirst = false;
}
if (UpdateCompleted != null)
{
if (totalBytesToReceive == 0)
{
totalDatetime = DateTime.Now;
totalBytesToReceive = e.BytesReceived;
return;
}
totalBytesToReceive = e.BytesReceived;
if (DownloadTimeout != -1)
{
if ((DateTime.Now - totalDatetime).TotalSeconds > DownloadTimeout)
{
((WebClientEx)sender).CancelAsync();
}
}
if (progressPercentage != e.ProgressPercentage && e.ProgressPercentage % 10 == 0)
{
progressPercentage = e.ProgressPercentage;
string msg = string.Format("...{0}%", e.ProgressPercentage);
string msg = string.Format("......{0}%", e.ProgressPercentage);
UpdateCompleted(this, new ResultEventArgs(false, msg));
}
}
@@ -150,29 +138,19 @@ namespace v2rayN.Handler
{
try
{
if (UpdateCompleted != null)
if (e.Error == null
|| Utils.IsNullOrEmpty(e.Error.ToString()))
{
if (e.Cancelled)
if (UpdateCompleted != null)
{
((WebClientEx)sender).Dispose();
TimeSpan ts = (DateTime.Now - totalDatetime);
string speed = string.Format("<{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.##"));
UpdateCompleted(this, new ResultEventArgs(true, speed));
return;
}
if (e.Error == null
|| Utils.IsNullOrEmpty(e.Error.ToString()))
{
TimeSpan ts = (DateTime.Now - totalDatetime);
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.##"));
UpdateCompleted(this, new ResultEventArgs(true, speed));
}
else
{
throw e.Error;
}
}
else
{
throw e.Error;
}
}
catch (Exception ex)
@@ -193,7 +171,8 @@ namespace v2rayN.Handler
string source = string.Empty;
try
{
SetSecurityProtocol();
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2
ServicePointManager.DefaultConnectionLimit = 256;
WebClientEx ws = new WebClientEx();
ws.DownloadStringCompleted += Ws_DownloadStringCompleted;
@@ -231,14 +210,5 @@ namespace v2rayN.Handler
Error(this, new ErrorEventArgs(ex));
}
}
private void SetSecurityProtocol()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
| SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
ServicePointManager.DefaultConnectionLimit = 256;
}
}
}
@@ -10,7 +10,22 @@ namespace v2rayN.HttpProxyHandler
/// </summary>
class HttpProxyHandle
{
private static bool Update(Config config, bool forceDisable)
private static string GetTimestamp(DateTime value)
{
return value.ToString("MMddHHmmssfff");
}
public static void ReSetPACProxy(Config config)
{
if (config.listenerType == 2)
{
//SysProxyHandle.SetIEProxy(false, false, null, null);
//PACServerHandle.Stop();
}
Update(config, false);
}
public static bool Update(Config config, bool forceDisable)
{
int type = config.listenerType;
@@ -23,40 +38,45 @@ namespace v2rayN.HttpProxyHandler
{
if (type != 0)
{
var port = Global.httpPort;
var port = Global.sysAgentPort;
if (port <= 0)
{
return false;
}
if (type == 1)
{
//PACServerHandle.Stop();
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}", null);
PACServerHandle.Stop();
PACFileWatcherHandle.StopWatch();
SysProxyHandle.SetIEProxy(true, true, "127.0.0.1:" + port, null);
}
else if (type == 2)
{
string pacUrl = GetPacUrl();
SysProxyHandle.SetIEProxy(true, false, null, pacUrl);
//PACServerHandle.Stop();
PACServerHandle.Stop();
PACServerHandle.Init(config);
PACFileWatcherHandle.StartWatch(config);
}
else if (type == 3)
{
//PACServerHandle.Stop();
PACServerHandle.Stop();
PACFileWatcherHandle.StopWatch();
SysProxyHandle.SetIEProxy(false, false, null, null);
}
else if (type == 4)
{
string pacUrl = GetPacUrl();
SysProxyHandle.SetIEProxy(false, false, null, null);
//PACServerHandle.Stop();
PACServerHandle.Stop();
PACServerHandle.Init(config);
PACFileWatcherHandle.StartWatch(config);
}
}
else
{
SysProxyHandle.SetIEProxy(false, false, null, null);
//PACServerHandle.Stop();
PACServerHandle.Stop();
PACFileWatcherHandle.StopWatch();
}
}
catch (Exception ex)
@@ -70,11 +90,11 @@ namespace v2rayN.HttpProxyHandler
/// 启用系统代理(http)
/// </summary>
/// <param name="config"></param>
private static void StartHttpAgent(Config config)
public static void StartHttpAgent(Config config)
{
try
{
int localPort = config.GetLocalPort(Global.InboundSocks);
int localPort = config.GetLocalPort("socks");
if (localPort > 0)
{
PrivoxyHandler.Instance.Start(localPort, config);
@@ -82,8 +102,8 @@ namespace v2rayN.HttpProxyHandler
{
Global.sysAgent = true;
Global.socksPort = localPort;
Global.httpPort = PrivoxyHandler.Instance.RunningPort;
Global.pacPort = config.GetLocalPort("pac");
Global.sysAgentPort = PrivoxyHandler.Instance.RunningPort;
Global.pacPort = Global.sysAgentPort + 1;
}
}
}
@@ -100,13 +120,16 @@ namespace v2rayN.HttpProxyHandler
{
try
{
Update(config, true);
////开启全局代理则关闭
//if (Global.sysAgent)
//{
PrivoxyHandler.Instance.Stop();
Global.sysAgent = false;
Global.socksPort = 0;
Global.httpPort = 0;
Global.sysAgentPort = 0;
Global.pacPort = 0;
//}
}
catch
{
@@ -118,7 +141,7 @@ namespace v2rayN.HttpProxyHandler
/// </summary>
/// <param name="config"></param>
/// <param name="forced"></param>
public static void RestartHttpAgent(Config config, bool forced)
public static bool RestartHttpAgent(Config config, bool forced)
{
bool isRestart = false;
//强制重启或者socks端口变化
@@ -128,7 +151,7 @@ namespace v2rayN.HttpProxyHandler
}
else
{
int localPort = config.GetLocalPort(Global.InboundSocks);
int localPort = config.GetLocalPort("socks");
if (localPort != Global.socksPort)
{
isRestart = true;
@@ -138,13 +161,16 @@ namespace v2rayN.HttpProxyHandler
{
CloseHttpAgent(config);
StartHttpAgent(config);
return true;
}
Update(config, false);
return false;
}
public static string GetPacUrl()
{
string pacUrl = $"http://{Global.Loopback}:{Global.pacPort}/pac/?t={ DateTime.Now.ToString("HHmmss")}";
string pacUrl = string.Format("http://127.0.0.1:{0}/pac/?t={1}", Global.pacPort,
GetTimestamp(DateTime.Now));
return pacUrl;
}
}
@@ -3,14 +3,14 @@ using System.Net;
using System.Text;
using System.Threading;
namespace v2rayN.Base
namespace v2rayN.HttpProxyHandler
{
public class HttpWebServer
{
private HttpListener _listener;
private Func<string, string> _responderMethod;
private Func<HttpListenerRequest, string> _responderMethod;
public HttpWebServer(string[] prefixes, Func<string, string> method)
public HttpWebServer(string[] prefixes, Func<HttpListenerRequest, string> method)
{
try
{
@@ -43,7 +43,7 @@ namespace v2rayN.Base
}
}
public HttpWebServer(Func<string, string> method, params string[] prefixes)
public HttpWebServer(Func<HttpListenerRequest, string> method, params string[] prefixes)
: this(prefixes, method) { }
public void Run()
@@ -60,10 +60,8 @@ namespace v2rayN.Base
var ctx = c as HttpListenerContext;
try
{
string address = ctx.Request.LocalEndPoint.Address.ToString();
Utils.SaveLog("Webserver Request " + address);
string rstr = _responderMethod(address);
byte[] buf = Encoding.UTF8.GetBytes(rstr);
string rstr = _responderMethod(ctx.Request);
byte[] buf = ASCIIEncoding.ASCII.GetBytes(rstr);
ctx.Response.StatusCode = 200;
ctx.Response.ContentType = "application/x-ns-proxy-autoconfig";
ctx.Response.ContentLength64 = buf.Length;
@@ -0,0 +1,133 @@
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
namespace v2rayN.HttpProxyHandler
{
public class HttpWebServerB
{
private int port;
private TcpListener listener;
private Func<TcpClient, string> _responderMethod;
public HttpWebServerB(int port, Func<TcpClient, string> method)
{
try
{
this.port = port;
this._responderMethod = method;
listener = new TcpListener(new IPEndPoint(IPAddress.Any, port));
listener.Server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
listener.Start();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
throw;
}
Utils.SaveLog("WebserverB running...");
AsyncCallback callback = null;
listener.BeginAcceptTcpClient(callback = ((ares) =>
{
try
{
if (listener != null)
{
TcpClient tcpClient = listener.EndAcceptTcpClient(ares);
listener.BeginAcceptTcpClient(callback, null);
if (tcpClient != null && _responderMethod != null)
{
string pac = _responderMethod(tcpClient);
NetworkStream netStream = tcpClient.GetStream();
if (netStream.CanRead)
{
// Reads NetworkStream into a byte buffer.
byte[] bytes = new byte[tcpClient.ReceiveBufferSize];
// Read can return anything from 0 to numBytesToRead.
// This method blocks until at least one byte is read.
netStream.Read(bytes, 0, (int)tcpClient.ReceiveBufferSize);
// Returns the data received from the host to the console.
string returndata = Encoding.UTF8.GetString(bytes);
if (!Utils.IsNullOrEmpty(returndata)
&& returndata.IndexOf("/pac/") >= 0
&& netStream.CanWrite)
{
BinaryWriter writer = new BinaryWriter(netStream);
//writeSuccess(writer, pac);
Byte[] sendBytes = ASCIIEncoding.ASCII.GetBytes(writeSuccess(pac));
writer.Write(sendBytes, 0, sendBytes.Length);
writer.Flush();
writer.Close();
}
}
netStream.Close();
tcpClient.Close();
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
//Console.WriteLine("Client connected completed");
}), null);
}
public void Stop()
{
if (listener != null)
{
listener.Stop();
listener = null;
}
}
//private static void writeSuccess(BinaryWriter writer, string pac)
//{
// writer.Write("HTTP/1.0 200 OK");
// writer.Write(Environment.NewLine);
// writer.Write("Content-Type:application/x-ns-proxy-autoconfig; charset=UTF-8");
// writer.Write(Environment.NewLine);
// writer.Write("Content-Length: " + pac.Length);
// writer.Write(Environment.NewLine);
// writer.Write(Environment.NewLine);
// writer.Write(pac);
// writer.Flush();
//}
private static string writeSuccess(string pac)
{
StringBuilder sb = new StringBuilder();
string content_type = "application/x-ns-proxy-autoconfig";
sb.Append("HTTP/1.0 200 OK");
sb.AppendLine();
sb.Append(String.Format("Content-Type:{0};", content_type));
sb.AppendLine();
//sb.Append("Connection: close");
//sb.AppendLine();
sb.Append(pac);
sb.AppendLine();
return sb.ToString();
}
}
}
@@ -0,0 +1,45 @@
using System.IO;
using System.Windows.Forms;
using v2rayN.Mode;
namespace v2rayN.HttpProxyHandler
{
/// <summary>
/// 提供PAC功能支持
/// </summary>
class PACFileWatcherHandle
{
private static FileSystemWatcher fileSystemWatcher;
private static long fileSize;
public static void StartWatch(Config config)
{
if (fileSystemWatcher == null)
{
fileSystemWatcher = new FileSystemWatcher(Utils.StartupPath());
fileSystemWatcher.Filter = "pac.txt";
fileSystemWatcher.NotifyFilter = NotifyFilters.Size;
fileSystemWatcher.Changed += (sender, args) =>
{
var fileInfo = new FileInfo(args.FullPath);
if (fileSize != fileInfo.Length)
{
fileSize = fileInfo.Length;
HttpProxyHandle.ReSetPACProxy(config);
}
};
}
fileSystemWatcher.EnableRaisingEvents = true;
}
public static void StopWatch()
{
if (fileSystemWatcher != null)
{
fileSystemWatcher.EnableRaisingEvents = false;
}
}
}
}
@@ -4,7 +4,6 @@ using System.IO;
using System.Net;
using System.Text;
using Newtonsoft.Json;
using v2rayN.Base;
using v2rayN.Mode;
using v2rayN.Properties;
@@ -29,13 +28,13 @@ namespace v2rayN.HttpProxyHandler
}
}
private const string GFWLIST_URL = "https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt";
private static readonly IEnumerable<char> IgnoredLineBegins = new[] { '!', '[' };
public void UpdatePACFromGFWList(Config config)
{
string url = Global.GFWLIST_URL;
string url = GFWLIST_URL;
if (!Utils.IsNullOrEmpty(config.urlGFWList))
{
url = config.urlGFWList;
@@ -47,7 +46,7 @@ namespace v2rayN.HttpProxyHandler
//{
// throw new Exception("未发现HTTP代理,无法设置代理更新");
//}
var http = new WebClientEx();
WebClient http = new WebClient();
//http.Headers.Add("Connection", "Close");
//http.Proxy = new WebProxy(IPAddress.Loopback.ToString(), httpProxy.localPort);
http.DownloadStringCompleted += http_DownloadStringCompleted;
@@ -76,7 +75,7 @@ namespace v2rayN.HttpProxyHandler
public static List<string> ParseResult(string response)
{
byte[] bytes = Convert.FromBase64String(response);
string content = Encoding.UTF8.GetString(bytes);
string content = Encoding.ASCII.GetString(bytes);
List<string> valid_lines = new List<string>();
using (var sr = new StringReader(content))
{
@@ -1,11 +1,12 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.Tool;
using v2rayN.Base;
namespace v2rayN.HttpProxyHandler
{
@@ -18,27 +19,13 @@ namespace v2rayN.HttpProxyHandler
private static HttpWebServer server;
private static HttpWebServerB serverB;
public static bool IsRunning
{
get
{
return (pacPort > 0);
}
}
public static void Init(Config config)
{
Global.pacPort = config.GetLocalPort("pac");
if (InitServer("*"))
if (InitServer("127.0.0.1"))
{
pacPort = Global.pacPort;
}
//else if (InitServer(Global.Loopback))
//{
// pacPort = Global.pacPort;
//}
else if (InitServerB(Global.Loopback))
else if (InitServerB("127.0.0.1"))
{
pacPort = Global.pacPort;
}
@@ -47,9 +34,18 @@ namespace v2rayN.HttpProxyHandler
Utils.SaveLog("Webserver init failed ");
pacPort = 0;
}
//if (Utils.IsAdministrator())
//{
// InitServer("127.0.0.1");
//}
//else
//{
// InitServerB("127.0.0.1");
//}
}
private static bool InitServer(string address)
public static bool InitServer(string address)
{
try
{
@@ -63,12 +59,13 @@ namespace v2rayN.HttpProxyHandler
if (server == null)
{
string prefixes = string.Format("http://{0}:{1}/pac/", address, Global.pacPort);
string prefixes = string.Format("http://{0}:{1}/pac/", "+", Global.pacPort);
Utils.SaveLog("Webserver prefixes " + prefixes);
server = new HttpWebServer(SendResponse, prefixes);
server.Run();
HttpWebServer ws = new HttpWebServer(SendResponse, prefixes);
ws.Run();
//pacPort = Global.pacPort;
}
}
Utils.SaveLog("Webserver at " + address);
@@ -81,6 +78,7 @@ namespace v2rayN.HttpProxyHandler
return true;
}
public static bool InitServerB(string address)
{
try
@@ -96,6 +94,7 @@ namespace v2rayN.HttpProxyHandler
if (serverB == null)
{
serverB = new HttpWebServerB(Global.pacPort, SendResponse);
//pacPort = Global.pacPort;
}
}
Utils.SaveLog("WebserverB at " + address);
@@ -108,10 +107,11 @@ namespace v2rayN.HttpProxyHandler
return true;
}
public static string SendResponse(string address)
public static string SendResponse(HttpListenerRequest request)
{
try
{
string address = request.LocalEndPoint.Address.ToString();
var pac = GetPacList(address);
return pac;
}
@@ -122,25 +122,41 @@ namespace v2rayN.HttpProxyHandler
}
}
public static void Stop()
public static string SendResponse(TcpClient tcpClient)
{
try
{
if (server != null)
{
server.Stop();
server = null;
}
if (serverB != null)
{
serverB.Stop();
serverB = null;
}
var address = ((IPEndPoint)tcpClient.Client.LocalEndPoint).Address.ToString();
var pac = GetPacList(address);
Console.WriteLine("SendResponse addr " + address);
//Utils.SaveLog("SendResponse addr " + address);
return pac;
}
catch (Exception ex)
{
Utils.SaveLog("Webserver Stop " + ex.Message);
Utils.SaveLog(ex.Message, ex);
}
return "";
}
public static void Stop()
{
//try
//{
// if (server != null)
// {
// server.Stop();
// server = null;
// }
//}
//catch (Exception ex)
//{
// Utils.SaveLog("Webserver Stop " + ex.Message);
//}
//try
//{
@@ -161,10 +177,9 @@ namespace v2rayN.HttpProxyHandler
//}
}
private static string GetPacList(string address)
{
var port = Global.httpPort;
var port = Global.sysAgentPort;
if (port <= 0)
{
return "No port";
@@ -189,6 +204,5 @@ namespace v2rayN.HttpProxyHandler
}
return "No pac content";
}
}
}
@@ -24,6 +24,8 @@ namespace v2rayN.HttpProxyHandler
private static string _uniqueConfigFile;
private static Job _privoxyJob;
private Process _process;
private int _runningPort;
private bool _isRunning;
static PrivoxyHandler()
{
@@ -34,6 +36,7 @@ namespace v2rayN.HttpProxyHandler
_privoxyJob = new Job();
FileManager.UncompressFile(Utils.GetTempPath("v2ray_privoxy.exe"), Resources.privoxy_exe);
FileManager.UncompressFile(Utils.GetTempPath("mgwz.dll"), Resources.mgwz_dll);
}
catch (IOException ex)
{
@@ -63,38 +66,47 @@ namespace v2rayN.HttpProxyHandler
public int RunningPort
{
get; set;
get
{
return _runningPort;
}
}
public bool IsRunning
{
get
{
return _isRunning;
}
}
public void Start(int localPort, Config config)
{
try
if (_process == null)
{
if (_process == null)
Process[] existingPrivoxy = Process.GetProcessesByName("v2ray_privoxy");
foreach (Process p in existingPrivoxy.Where(IsChildProcess))
{
Process[] existingPrivoxy = Process.GetProcessesByName("v2ray_privoxy");
foreach (Process p in existingPrivoxy.Where(IsChildProcess))
{
KillProcess(p);
}
string privoxyConfig = Resources.privoxy_conf;
RunningPort = config.GetLocalPort(Global.InboundHttp);
privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", localPort.ToString());
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", RunningPort.ToString());
if (config.allowLANConn)
{
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", "0.0.0.0");
}
else
{
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", Global.Loopback);
}
FileManager.ByteArrayToFile(Utils.GetTempPath(_uniqueConfigFile), Encoding.UTF8.GetBytes(privoxyConfig));
KillProcess(p);
}
string privoxyConfig = Resources.privoxy_conf;
_runningPort = GetFreePort(localPort);
privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", localPort.ToString());
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", _runningPort.ToString());
if (config.allowLANConn)
{
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", "0.0.0.0");
}
else
{
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", "127.0.0.1");
}
FileManager.ByteArrayToFile(Utils.GetTempPath(_uniqueConfigFile), Encoding.UTF8.GetBytes(privoxyConfig));
_process = new Process
{
// Configure the process using the StartInfo properties.
StartInfo =
_process = new Process
{
// Configure the process using the StartInfo properties.
StartInfo =
{
FileName = "v2ray_privoxy.exe",
Arguments = _uniqueConfigFile,
@@ -103,20 +115,15 @@ namespace v2rayN.HttpProxyHandler
UseShellExecute = true,
CreateNoWindow = true
}
};
_process.Start();
};
_process.Start();
/*
* Add this process to job obj associated with this ss process, so that
* when ss exit unexpectedly, this process will be forced killed by system.
*/
_privoxyJob.AddProcess(_process.Handle);
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
/*
* Add this process to job obj associated with this ss process, so that
* when ss exit unexpectedly, this process will be forced killed by system.
*/
_privoxyJob.AddProcess(_process.Handle);
_isRunning = true;
}
}
@@ -127,7 +134,7 @@ namespace v2rayN.HttpProxyHandler
KillProcess(_process);
_process.Dispose();
_process = null;
RunningPort = 0;
_isRunning = false;
}
}
@@ -184,5 +191,25 @@ namespace v2rayN.HttpProxyHandler
}
}
private int GetFreePort(int localPort)
{
int defaultPort = 8123;
try
{
//// TCP stack please do me a favor
//TcpListener l = new TcpListener(IPAddress.Loopback, 0);
//l.Start();
//var port = ((IPEndPoint)l.LocalEndpoint).Port;
//l.Stop();
//return port;
return localPort + 1;
}
catch (Exception ex)
{
// in case access denied
Utils.SaveLog(ex.Message, ex);
return defaultPort;
}
}
}
}
@@ -1,9 +1,8 @@
using Newtonsoft.Json;
using System;
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using v2rayN.Base;
using Newtonsoft.Json;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.Tool;
@@ -50,14 +49,14 @@ namespace v2rayN.HttpProxyHandler
public static void SetIEProxy(bool enable, bool global, string proxyServer, string pacURL)
{
//Read();
Read();
//if (!_userSettings.UserSettingsRecorded)
//{
// // record user settings
// ExecSysproxy("query");
// ParseQueryStr(_queryStr);
//}
if (!_userSettings.UserSettingsRecorded)
{
// record user settings
ExecSysproxy("query");
ParseQueryStr(_queryStr);
}
string arguments;
if (enable)
@@ -72,19 +71,17 @@ namespace v2rayN.HttpProxyHandler
else
{
// restore user settings
//var flags = _userSettings.Flags;
//var proxy_server = _userSettings.ProxyServer ?? "-";
//var bypass_list = _userSettings.BypassList ?? "-";
//var pac_url = _userSettings.PacUrl ?? "-";
////arguments = string.Format("set {0} {1} {2} {3}", flags, proxy_server, bypass_list, pac_url);
//set null settings
arguments = string.Format("set {0} {1} {2} {3}", 1, "-", "<local>", @"http://127.0.0.1");
var flags = _userSettings.Flags;
var proxy_server = _userSettings.ProxyServer ?? "-";
var bypass_list = _userSettings.BypassList ?? "-";
var pac_url = _userSettings.PacUrl ?? "-";
arguments = string.Format("set {0} {1} {2} {3}", flags, proxy_server, bypass_list, pac_url);
// have to get new settings
//_userSettings.UserSettingsRecorded = false;
_userSettings.UserSettingsRecorded = false;
}
//Save();
Save();
ExecSysproxy(arguments);
}
@@ -0,0 +1,22 @@
using System;
using System.Net;
namespace v2rayN.HttpProxyHandler
{
class WebClientEx : WebClient
{
public int Timeout { get; set; }
public WebClientEx(int timeout = 3000)
{
Timeout = timeout;
}
protected override WebRequest GetWebRequest(Uri address)
{
var request = base.GetWebRequest(address);
request.Timeout = Timeout;
return request;
}
}
}
+72 -229
View File
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using v2rayN.Base;
using System.Text.RegularExpressions;
namespace v2rayN.Mode
{
@@ -13,161 +13,122 @@ namespace v2rayN.Mode
/// <summary>
/// 本地监听
/// </summary>
public List<InItem> inbound
{
get; set;
}
public List<InItem> inbound { get; set; }
/// <summary>
/// 允许日志
/// </summary>
public bool logEnabled
{
get; set;
}
public bool logEnabled { get; set; }
/// <summary>
/// 日志等级
/// </summary>
public string loglevel
{
get; set;
}
public string loglevel { get; set; }
/// <summary>
/// 活动配置序号
/// </summary>
public int index
{
get; set;
}
public int index { get; set; }
/// <summary>
/// vmess服务器信息
/// </summary>
public List<VmessItem> vmess
{
get; set;
}
public List<VmessItem> vmess { get; set; }
/// <summary>
/// 允许Mux多路复用
/// </summary>
public bool muxEnabled
{
get; set;
}
public bool muxEnabled { get; set; }
/// <summary>
/// 域名解析策略
/// </summary>
public string domainStrategy
{
get; set;
}
public string domainStrategy { get; set; }
/// <summary>
/// 路由模式
/// </summary>
public string routingMode
{
get; set;
}
public string routingMode { get; set; }
/// <summary>
/// 用户自定义需代理的网址或ip
/// </summary>
public List<string> useragent
{
get; set;
}
public List<string> useragent { get; set; }
/// <summary>
/// 用户自定义直连的网址或ip
/// </summary>
public List<string> userdirect
{
get; set;
}
public List<string> userdirect { get; set; }
/// <summary>
/// 用户自定义阻止的网址或ip
/// </summary>
public List<string> userblock
{
get; set;
}
public List<string> userblock { get; set; }
/// <summary>
/// KcpItem
/// </summary>
public KcpItem kcpItem
{
get; set;
}
public KcpItem kcpItem { get; set; }
/// <summary>
/// 监听状态 0-not 1-http 2-PAC
/// 启用Http代理
/// </summary>
public int listenerType
{
get; set;
}
public bool sysAgentEnabled { get; set; }
/// <summary>
/// 监听状态 0-不改变 1-全局 2-PAC
/// </summary>
public int listenerType { get; set; }
/// <summary>
/// 自定义GFWList url
/// </summary>
public string urlGFWList
{
get; set;
}
public string urlGFWList { get; set; }
/// <summary>
/// 允许来自局域网的连接
/// </summary>
public bool allowLANConn
{
get; set;
}
public bool allowLANConn { get; set; }
/// <summary>
/// 启用实时网速和流量统计
/// </summary>
public bool enableStatistics
{
get; set;
}
public bool enableStatistics { get; set; }
/// <summary>
/// 视图刷新率
/// </summary>
public int statisticsFreshRate
{
get; set;
public int statisticsFreshRate { get; set; }
/// <summary>
/// 统计数据缓存天数 [0, 30]
/// * 0 关闭单独每天使用流量的缓存
/// * 无论如何不会关闭总流量的缓存
/// </summary>
private uint cacheDays;
public uint CacheDays {
get { return cacheDays; }
set
{
if (value < 0) cacheDays = 0;
else if (value > 30) cacheDays = 30;
else cacheDays = value;
}
}
/// <summary>
/// 自定义远程DNS
/// </summary>
public string remoteDNS
{
get; set;
}
public string remoteDNS { get; set; }
/// <summary>
/// 订阅
/// </summary>
public List<SubItem> subItem
{
get; set;
}
public List<SubItem> subItem { get; set; }
/// <summary>
/// UI
/// </summary>
public UIItem uiItem
{
get; set;
}
public UIItem uiItem { get; set; }
#region 函数
@@ -275,19 +236,6 @@ namespace v2rayN.Mode
public int GetLocalPort(string protocol)
{
if (protocol == Global.InboundHttp)
{
return GetLocalPort(Global.InboundSocks) + 1;
}
else if (protocol == "pac")
{
return GetLocalPort(Global.InboundSocks) + 2;
}
else if (protocol == "speedtest")
{
return GetLocalPort(Global.InboundSocks) + 103;
}
int localPort = 0;
foreach (InItem inItem in inbound)
{
@@ -318,16 +266,6 @@ namespace v2rayN.Mode
return vmess[index].getSummary();
}
public string getItemId()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].getItemId();
}
#endregion
}
@@ -411,136 +349,80 @@ namespace v2rayN.Mode
}
return subid.Substring(0, 4);
}
public string getItemId()
{
var itemId = $"{address}{port}{requestHost}{path}";
itemId = Utils.Base64Encode(itemId);
return itemId;
}
/// <summary>
/// 版本(现在=2)
/// </summary>
public int configVersion
{
get; set;
}
public int configVersion { get; set; }
/// <summary>
/// 远程服务器地址
/// </summary>
public string address
{
get; set;
}
public string address { get; set; }
/// <summary>
/// 远程服务器端口
/// </summary>
public int port
{
get; set;
}
public int port { get; set; }
/// <summary>
/// 远程服务器ID
/// </summary>
public string id
{
get; set;
}
public string id { get; set; }
/// <summary>
/// 远程服务器额外ID
/// </summary>
public int alterId
{
get; set;
}
public int alterId { get; set; }
/// <summary>
/// 本地安全策略
/// </summary>
public string security
{
get; set;
}
public string security { get; set; }
/// <summary>
/// tcp,kcp,ws
/// </summary>
public string network
{
get; set;
}
public string network { get; set; }
/// <summary>
/// 备注或别名
/// </summary>
public string remarks
{
get; set;
}
public string remarks { get; set; }
/// <summary>
/// 伪装类型
/// </summary>
public string headerType
{
get; set;
}
public string headerType { get; set; }
/// <summary>
/// 伪装的域名
/// </summary>
public string requestHost
{
get; set;
}
public string requestHost { get; set; }
/// <summary>
/// ws h2 path
/// </summary>
public string path
{
get; set;
}
public string path { get; set; }
/// <summary>
/// 底层传输安全
/// </summary>
public string streamSecurity
{
get; set;
}
public string streamSecurity { get; set; }
/// <summary>
/// 是否允许不安全连接(用于客户端)
/// </summary>
public string allowInsecure
{
get; set;
}
public string allowInsecure { get; set; }
/// <summary>
/// config type(1=normal,2=custom)
/// </summary>
public int configType
{
get; set;
}
public int configType { get; set; }
/// <summary>
///
/// </summary>
public string testResult
{
get; set;
}
public string testResult { get; set; }
/// <summary>
/// SubItem id
/// </summary>
public string subid
{
get; set;
}
public string subid { get; set; }
}
[Serializable]
@@ -549,26 +431,17 @@ namespace v2rayN.Mode
/// <summary>
/// 本地监听端口
/// </summary>
public int localPort
{
get; set;
}
public int localPort { get; set; }
/// <summary>
/// 协议,默认为socks
/// </summary>
public string protocol
{
get; set;
}
public string protocol { get; set; }
/// <summary>
/// 允许udp
/// </summary>
public bool udpEnabled
{
get; set;
}
public bool udpEnabled { get; set; }
/// <summary>
/// 开启流量探测
@@ -582,52 +455,31 @@ namespace v2rayN.Mode
/// <summary>
///
/// </summary>
public int mtu
{
get; set;
}
public int mtu { get; set; }
/// <summary>
///
/// </summary>
public int tti
{
get; set;
}
public int tti { get; set; }
/// <summary>
///
/// </summary>
public int uplinkCapacity
{
get; set;
}
public int uplinkCapacity { get; set; }
/// <summary>
///
/// </summary>
public int downlinkCapacity
{
get; set;
}
public int downlinkCapacity { get; set; }
/// <summary>
///
/// </summary>
public bool congestion
{
get; set;
}
public bool congestion { get; set; }
/// <summary>
///
/// </summary>
public int readBufferSize
{
get; set;
}
public int readBufferSize { get; set; }
/// <summary>
///
/// </summary>
public int writeBufferSize
{
get; set;
}
public int writeBufferSize { get; set; }
}
@@ -637,26 +489,17 @@ namespace v2rayN.Mode
/// <summary>
///
/// </summary>
public string id
{
get; set;
}
public string id { get; set; }
/// <summary>
/// 备注
/// </summary>
public string remarks
{
get; set;
}
public string remarks { get; set; }
/// <summary>
/// url
/// </summary>
public string url
{
get; set;
}
public string url { get; set; }
/// <summary>
/// enable
+24 -32
View File
@@ -1,43 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace v2rayN.Mode
{
[Serializable]
public class ServerStatistics
class ServerStatistics
{
public List<ServerStatItem> server
{
get; set;
}
}
public string name;
public string address;
public int port;
public string path;
public string host;
public ulong totalUp;
public ulong totalDown;
public ulong todayUp;
public ulong todayDown;
[Serializable]
public class ServerStatItem
{
public string itemId
public ServerStatistics() { }
public ServerStatistics(string name, string addr, int port, string path, string host, ulong totalUp, ulong totalDown, ulong todayUp, ulong todayDown)
{
get; set;
}
public ulong totalUp
{
get; set;
}
public ulong totalDown
{
get; set;
}
public ulong todayUp
{
get; set;
}
public ulong todayDown
{
get; set;
}
public long dateNow
{
get; set;
this.name = name;
this.address = addr;
this.port = port;
this.path = path;
this.host = host;
this.totalUp = totalUp;
this.totalDown = totalDown;
this.todayUp = todayUp;
this.todayDown = todayDown;
}
}
}
+1 -1
View File
@@ -310,7 +310,7 @@ namespace v2rayN.Mode
/// </summary>
public string port { get; set; }
public List<string> inboundTag { get; set; }
public string inboundTag { get; set; }
/// <summary>
///
/// </summary>
+1 -1
View File
@@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
// 方法是按如下所示使用“*”:
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("2.53")]
[assembly: AssemblyFileVersion("2.40")]
+6 -27
View File
@@ -90,26 +90,6 @@ namespace v2rayN.Properties {
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] grpc_csharp_ext_x64_dll {
get {
object obj = ResourceManager.GetObject("grpc_csharp_ext_x64_dll", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] grpc_csharp_ext_x86_dll {
get {
object obj = ResourceManager.GetObject("grpc_csharp_ext_x86_dll", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
@@ -121,21 +101,21 @@ namespace v2rayN.Properties {
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap minimize {
internal static byte[] mgwz_dll {
get {
object obj = ResourceManager.GetObject("minimize", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
object obj = ResourceManager.GetObject("mgwz_dll", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap notify {
internal static System.Drawing.Bitmap minimize {
get {
object obj = ResourceManager.GetObject("notify", resourceCulture);
object obj = ResourceManager.GetObject("minimize", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -167,7 +147,6 @@ namespace v2rayN.Properties {
///show-on-task-bar 0
///activity-animation 0
///forward-socks5 / 127.0.0.1:__SOCKS_PORT__ .
///max-client-connections 2048
///hide-console
/// 的本地化字符串。
/// </summary>
+3 -9
View File
@@ -127,21 +127,15 @@
<data name="checkupdate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\checkupdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="grpc_csharp_ext_x64_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\grpc_csharp_ext.x64.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="grpc_csharp_ext_x86_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\grpc_csharp_ext.x86.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="help" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="mgwz_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\mgwz.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="minimize" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notify" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\notify.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="option" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\option.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.
-1
View File
@@ -4,5 +4,4 @@ logfile v2ray_privoxy.log
show-on-task-bar 0
activity-animation 0
forward-socks5 / 127.0.0.1:__SOCKS_PORT__ .
max-client-connections 2048
hide-console
+98 -98
View File
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@@ -13,13 +13,13 @@ namespace v2rayN.Resx {
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class ResUI {
@@ -33,7 +33,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
@@ -47,8 +47,8 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
@@ -61,7 +61,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Batch export subscription to clipboard successfully 的本地化字符串。
/// Looks up a localized string similar to Batch export subscription to clipboard successfully.
/// </summary>
internal static string BatchExportSubscriptionSuccessfully {
get {
@@ -70,7 +70,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Batch export share URL to clipboard successfully 的本地化字符串。
/// Looks up a localized string similar to Batch export share URL to clipboard successfully.
/// </summary>
internal static string BatchExportURLSuccessfully {
get {
@@ -79,7 +79,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please check the server settings first 的本地化字符串。
/// Looks up a localized string similar to Please check the server settings first.
/// </summary>
internal static string CheckServerSettings {
get {
@@ -88,7 +88,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 configuration format is incorrect 的本地化字符串。
/// Looks up a localized string similar to configuration format is incorrect.
/// </summary>
internal static string ConfigurationFormatIncorrect {
get {
@@ -97,7 +97,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Note that custom configuration relies entirely on your own configuration and does not work with all settings. The system agent is available when the socks port is equal to the port in the settings in the custom configuration inbound. 的本地化字符串。
/// Looks up a localized string similar to Note that custom configuration relies entirely on your own configuration and does not work with all settings. The system agent is available when the socks port is equal to the port in the settings in the custom configuration inbound..
/// </summary>
internal static string CustomServerTips {
get {
@@ -106,7 +106,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 DOWN 的本地化字符串。
/// Looks up a localized string similar to DOWN.
/// </summary>
internal static string downloadSpeed {
get {
@@ -115,7 +115,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Whether to download? {0} 的本地化字符串。
/// Looks up a localized string similar to Whether to download? {0}.
/// </summary>
internal static string DownloadYesNo {
get {
@@ -124,7 +124,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to convert configuration file 的本地化字符串。
/// Looks up a localized string similar to Failed to convert configuration file.
/// </summary>
internal static string FailedConversionConfiguration {
get {
@@ -133,7 +133,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to generate default configuration file 的本地化字符串。
/// Looks up a localized string similar to Failed to generate default configuration file.
/// </summary>
internal static string FailedGenDefaultConfiguration {
get {
@@ -142,7 +142,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to get the default configuration 的本地化字符串。
/// Looks up a localized string similar to Failed to get the default configuration.
/// </summary>
internal static string FailedGetDefaultConfiguration {
get {
@@ -151,7 +151,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to import custom configuration server 的本地化字符串。
/// Looks up a localized string similar to Failed to import custom configuration server.
/// </summary>
internal static string FailedImportedCustomServer {
get {
@@ -160,7 +160,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to read configuration file 的本地化字符串。
/// Looks up a localized string similar to Failed to read configuration file.
/// </summary>
internal static string FailedReadConfiguration {
get {
@@ -169,7 +169,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the correct format extra ID 的本地化字符串。
/// Looks up a localized string similar to Please fill in the correct format extra ID.
/// </summary>
internal static string FillCorrectAlterId {
get {
@@ -178,7 +178,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the correct format server port 的本地化字符串。
/// Looks up a localized string similar to Please fill in the correct format server port.
/// </summary>
internal static string FillCorrectServerPort {
get {
@@ -187,7 +187,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the KCP parameters correctly 的本地化字符串。
/// Looks up a localized string similar to Please fill in the KCP parameters correctly.
/// </summary>
internal static string FillKcpParameters {
get {
@@ -196,7 +196,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the local listening port 的本地化字符串。
/// Looks up a localized string similar to Please fill in the local listening port.
/// </summary>
internal static string FillLocalListeningPort {
get {
@@ -205,7 +205,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the password 的本地化字符串。
/// Looks up a localized string similar to Please fill in the password.
/// </summary>
internal static string FillPassword {
get {
@@ -214,7 +214,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the server address 的本地化字符串。
/// Looks up a localized string similar to Please fill in the server address.
/// </summary>
internal static string FillServerAddress {
get {
@@ -223,7 +223,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the user ID 的本地化字符串。
/// Looks up a localized string similar to Please fill in the user ID.
/// </summary>
internal static string FillUUID {
get {
@@ -232,7 +232,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 is not the correct client configuration file, please check 的本地化字符串。
/// Looks up a localized string similar to is not the correct client configuration file, please check.
/// </summary>
internal static string IncorrectClientConfiguration {
get {
@@ -241,7 +241,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 is not the correct configuration, please check 的本地化字符串。
/// Looks up a localized string similar to is not the correct configuration, please check.
/// </summary>
internal static string Incorrectconfiguration {
get {
@@ -250,7 +250,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 is not the correct server configuration file, please check 的本地化字符串。
/// Looks up a localized string similar to is not the correct server configuration file, please check.
/// </summary>
internal static string IncorrectServerConfiguration {
get {
@@ -259,7 +259,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Initial Configuration 的本地化字符串。
/// Looks up a localized string similar to Initial Configuration.
/// </summary>
internal static string InitialConfiguration {
get {
@@ -268,7 +268,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Address 的本地化字符串。
/// Looks up a localized string similar to Address.
/// </summary>
internal static string LvAddress {
get {
@@ -277,7 +277,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Alias 的本地化字符串。
/// Looks up a localized string similar to Alias.
/// </summary>
internal static string LvAlias {
get {
@@ -286,7 +286,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Security 的本地化字符串。
/// Looks up a localized string similar to Security.
/// </summary>
internal static string LvEncryptionMethod {
get {
@@ -295,7 +295,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Port 的本地化字符串。
/// Looks up a localized string similar to Port.
/// </summary>
internal static string LvPort {
get {
@@ -304,7 +304,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Type 的本地化字符串。
/// Looks up a localized string similar to Type.
/// </summary>
internal static string LvServiceType {
get {
@@ -313,7 +313,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Subs 的本地化字符串。
/// Looks up a localized string similar to Subs.
/// </summary>
internal static string LvSubscription {
get {
@@ -322,7 +322,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Test Results 的本地化字符串。
/// Looks up a localized string similar to Test Results.
/// </summary>
internal static string LvTestResults {
get {
@@ -331,7 +331,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Today download traffic 的本地化字符串。
/// Looks up a localized string similar to Today download traffic.
/// </summary>
internal static string LvTodayDownloadDataAmount {
get {
@@ -340,7 +340,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Today upload traffic 的本地化字符串。
/// Looks up a localized string similar to Today upload traffic.
/// </summary>
internal static string LvTodayUploadDataAmount {
get {
@@ -349,7 +349,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Total download traffic 的本地化字符串。
/// Looks up a localized string similar to Total download traffic.
/// </summary>
internal static string LvTotalDownloadDataAmount {
get {
@@ -358,7 +358,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Total upload traffic 的本地化字符串。
/// Looks up a localized string similar to Total upload traffic.
/// </summary>
internal static string LvTotalUploadDataAmount {
get {
@@ -367,7 +367,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Transport 的本地化字符串。
/// Looks up a localized string similar to Transport.
/// </summary>
internal static string LvTransportProtocol {
get {
@@ -376,7 +376,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 MediumFresh 的本地化字符串。
/// Looks up a localized string similar to MediumFresh.
/// </summary>
internal static string MediumFresh {
get {
@@ -385,7 +385,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Clear original subscription content 的本地化字符串。
/// Looks up a localized string similar to Clear original subscription content.
/// </summary>
internal static string MsgClearSubscription {
get {
@@ -394,7 +394,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Download V2rayCore successfully 的本地化字符串。
/// Looks up a localized string similar to Download V2rayCore successfully.
/// </summary>
internal static string MsgDownloadV2rayCoreSuccessfully {
get {
@@ -403,7 +403,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to import subscription content 的本地化字符串。
/// Looks up a localized string similar to Failed to import subscription content.
/// </summary>
internal static string MsgFailedImportSubscription {
get {
@@ -412,7 +412,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Get the subscription content successfully 的本地化字符串。
/// Looks up a localized string similar to Get the subscription content successfully.
/// </summary>
internal static string MsgGetSubscriptionSuccessfully {
get {
@@ -421,7 +421,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 No valid subscriptions set 的本地化字符串。
/// Looks up a localized string similar to No valid subscriptions set.
/// </summary>
internal static string MsgNoValidSubscription {
get {
@@ -430,7 +430,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 PAC update failed 的本地化字符串。
/// Looks up a localized string similar to PAC update failed.
/// </summary>
internal static string MsgPACUpdateFailed {
get {
@@ -439,7 +439,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 PAC update succeeded 的本地化字符串。
/// Looks up a localized string similar to PAC update succeeded.
/// </summary>
internal static string MsgPACUpdateSuccessfully {
get {
@@ -448,7 +448,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Resolve V2rayCore successfully 的本地化字符串。
/// Looks up a localized string similar to Resolve V2rayCore successfully.
/// </summary>
internal static string MsgParsingV2rayCoreSuccessfully {
get {
@@ -457,7 +457,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Simplify PAC Success 的本地化字符串。
/// Looks up a localized string similar to Simplify PAC Success.
/// </summary>
internal static string MsgSimplifyPAC {
get {
@@ -466,7 +466,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Start getting subscriptions 的本地化字符串。
/// Looks up a localized string similar to Start getting subscriptions.
/// </summary>
internal static string MsgStartGettingSubscriptions {
get {
@@ -475,7 +475,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Start updating PAC... 的本地化字符串。
/// Looks up a localized string similar to Start updating PAC....
/// </summary>
internal static string MsgStartUpdatingPAC {
get {
@@ -484,7 +484,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Start updating V2rayCore... 的本地化字符串。
/// Looks up a localized string similar to Start updating V2rayCore....
/// </summary>
internal static string MsgStartUpdatingV2rayCore {
get {
@@ -493,7 +493,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Subscription content decoding failed (non-BASE64 code) 的本地化字符串。
/// Looks up a localized string similar to Subscription content decoding failed (non-BASE64 code).
/// </summary>
internal static string MsgSubscriptionDecodingFailed {
get {
@@ -502,7 +502,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 is unpacking... 的本地化字符串。
/// Looks up a localized string similar to is unpacking....
/// </summary>
internal static string MsgUnpacking {
get {
@@ -511,7 +511,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Update subscription end 的本地化字符串。
/// Looks up a localized string similar to Update subscription end.
/// </summary>
internal static string MsgUpdateSubscriptionEnd {
get {
@@ -520,7 +520,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Update subscription starts 的本地化字符串。
/// Looks up a localized string similar to Update subscription starts.
/// </summary>
internal static string MsgUpdateSubscriptionStart {
get {
@@ -529,7 +529,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Update V2rayCore successfully 的本地化字符串。
/// Looks up a localized string similar to Update V2rayCore successfully.
/// </summary>
internal static string MsgUpdateV2rayCoreSuccessfully {
get {
@@ -538,7 +538,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Update V2rayCore successfully! Restarting service... 的本地化字符串。
/// Looks up a localized string similar to Update V2rayCore successfully! Restarting service....
/// </summary>
internal static string MsgUpdateV2rayCoreSuccessfullyMore {
get {
@@ -547,7 +547,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 This feature relies on the Http global proxy, please set it correctly first. 的本地化字符串。
/// Looks up a localized string similar to This feature relies on the Http global proxy, please set it correctly first..
/// </summary>
internal static string NeedHttpGlobalProxy {
get {
@@ -556,7 +556,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Non-vmess or ss protocol 的本地化字符串。
/// Looks up a localized string similar to Non-vmess or ss protocol.
/// </summary>
internal static string NonvmessOrssProtocol {
get {
@@ -565,7 +565,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 non-Vmess service, this feature is invalid 的本地化字符串。
/// Looks up a localized string similar to non-Vmess service, this feature is invalid.
/// </summary>
internal static string NonVmessService {
get {
@@ -574,7 +574,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 V2ray-core not found, download address: {0} 的本地化字符串。
/// Looks up a localized string similar to V2ray-core not found, download address: {0}.
/// </summary>
internal static string NotFoundCore {
get {
@@ -583,7 +583,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Scan completed, no valid QR code found 的本地化字符串。
/// Looks up a localized string similar to Scan completed, no valid QR code found.
/// </summary>
internal static string NoValidQRcodeFound {
get {
@@ -592,7 +592,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 operation failed, please check retry 的本地化字符串。
/// Looks up a localized string similar to operation failed, please check retry.
/// </summary>
internal static string OperationFailed {
get {
@@ -601,7 +601,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please Fill Remarks 的本地化字符串。
/// Looks up a localized string similar to Please Fill Remarks.
/// </summary>
internal static string PleaseFillRemarks {
get {
@@ -610,7 +610,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please select the encryption method 的本地化字符串。
/// Looks up a localized string similar to Please select the encryption method.
/// </summary>
internal static string PleaseSelectEncryption {
get {
@@ -619,7 +619,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please select an agreement 的本地化字符串。
/// Looks up a localized string similar to Please select an agreement.
/// </summary>
internal static string PleaseSelectProtocol {
get {
@@ -628,7 +628,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please select the server first 的本地化字符串。
/// Looks up a localized string similar to Please select the server first.
/// </summary>
internal static string PleaseSelectServer {
get {
@@ -637,7 +637,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 QuickFresh 的本地化字符串。
/// Looks up a localized string similar to QuickFresh.
/// </summary>
internal static string QuickFresh {
get {
@@ -646,7 +646,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Are you sure to remove the server? 的本地化字符串。
/// Looks up a localized string similar to Are you sure to remove the server?.
/// </summary>
internal static string RemoveServer {
get {
@@ -655,7 +655,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 The client configuration file is saved at: {0} 的本地化字符串。
/// Looks up a localized string similar to The client configuration file is saved at: {0}.
/// </summary>
internal static string SaveClientConfigurationIn {
get {
@@ -664,7 +664,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 The server configuration file is saved at: {0} 的本地化字符串。
/// Looks up a localized string similar to The server configuration file is saved at: {0}.
/// </summary>
internal static string SaveServerConfigurationIn {
get {
@@ -673,7 +673,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 SlowFresh 的本地化字符串。
/// Looks up a localized string similar to SlowFresh.
/// </summary>
internal static string SlowFresh {
get {
@@ -682,7 +682,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node! 的本地化字符串。
/// Looks up a localized string similar to Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node!.
/// </summary>
internal static string SpeedServerTips {
get {
@@ -691,16 +691,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 PAC failed to start. Pls with an administrator. 的本地化字符串。
/// </summary>
internal static string StartPacFailed {
get {
return ResourceManager.GetString("StartPacFailed", resourceCulture);
}
}
/// <summary>
/// 查找类似 Start service ({0})...... 的本地化字符串。
/// Looks up a localized string similar to Start service ({0}).......
/// </summary>
internal static string StartService {
get {
@@ -709,8 +700,8 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Successful configuration
///{0} 的本地化字符串。
/// Looks up a localized string similar to Successful configuration
///{0}.
/// </summary>
internal static string SuccessfulConfiguration {
get {
@@ -719,7 +710,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Successfully imported custom configuration server 的本地化字符串。
/// Looks up a localized string similar to Successfully imported custom configuration server.
/// </summary>
internal static string SuccessfullyImportedCustomServer {
get {
@@ -728,7 +719,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Imported bulk URL from clipboard successfully 的本地化字符串。
/// Looks up a localized string similar to Imported bulk URL from clipboard successfully.
/// </summary>
internal static string SuccessfullyImportedServerViaClipboard {
get {
@@ -737,12 +728,21 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Scan import URL successfully 的本地化字符串。
/// Looks up a localized string similar to Scan import URL successfully.
/// </summary>
internal static string SuccessfullyImportedServerViaScan {
get {
return ResourceManager.GetString("SuccessfullyImportedServerViaScan", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to UP.
/// </summary>
internal static string uploadSpeed {
get {
return ResourceManager.GetString("uploadSpeed", resourceCulture);
}
}
}
}
+2 -2
View File
@@ -343,7 +343,7 @@
<data name="LvTotalUploadDataAmount" xml:space="preserve">
<value>Total upload traffic</value>
</data>
<data name="StartPacFailed" xml:space="preserve">
<value>PAC failed to start. Pls with an administrator.</value>
<data name="uploadSpeed" xml:space="preserve">
<value>UP</value>
</data>
</root>
+2 -2
View File
@@ -343,7 +343,7 @@
<data name="LvTotalUploadDataAmount" xml:space="preserve">
<value>总上传</value>
</data>
<data name="StartPacFailed" xml:space="preserve">
<value>PAC服务启动失败,请用管理员启动</value>
<data name="uploadSpeed" xml:space="preserve">
<value>上传</value>
</data>
</root>
+1 -1
View File
@@ -76,7 +76,7 @@
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"inboundTag": ["api"],
"inboundTag": "api",
"outboundTag": "api",
"type": "field"
}
@@ -1 +0,0 @@
geosite:category-ads,
-132
View File
@@ -1,132 +0,0 @@
domain:12306.com,
domain:51ym.me,
domain:52pojie.cn,
domain:8686c.com,
domain:abercrombie.com,
domain:adobesc.com,
domain:air-matters.com,
domain:air-matters.io,
domain:airtable.com,
domain:akadns.net,
domain:apache.org,
domain:api.crisp.chat,
domain:api.termius.com,
domain:appshike.com,
domain:appstore.com,
domain:aweme.snssdk.com,
domain:bababian.com,
domain:battle.net,
domain:beatsbydre.com,
domain:bet365.com,
domain:bilibili.cn,
domain:ccgslb.com,
domain:ccgslb.net,
domain:chunbo.com,
domain:chunboimg.com,
domain:clashroyaleapp.com,
domain:cloudsigma.com,
domain:cloudxns.net,
domain:cmfu.com,
domain:culturedcode.com,
domain:dct-cloud.com,
domain:didialift.com,
domain:douyutv.com,
domain:duokan.com,
domain:dytt8.net,
domain:easou.com,
domain:ecitic.net,
domain:eclipse.org,
domain:eudic.net,
domain:ewqcxz.com,
domain:fir.im,
domain:frdic.com,
domain:fresh-ideas.cc,
domain:godic.net,
domain:goodread.com,
domain:haibian.com,
domain:hdslb.net,
domain:hollisterco.com,
domain:hongxiu.com,
domain:hxcdn.net,
domain:images.unsplash.com,
domain:img4me.com,
domain:ipify.org,
domain:ixdzs.com,
domain:jd.hk,
domain:jianshuapi.com,
domain:jomodns.com,
domain:jsboxbbs.com,
domain:knewone.com,
domain:kuaidi100.com,
domain:lemicp.com,
domain:letvcloud.com,
domain:lizhi.io,
domain:localizecdn.com,
domain:lucifr.com,
domain:luoo.net,
domain:mai.tn,
domain:maven.org,
domain:miwifi.com,
domain:moji.com,
domain:moke.com,
domain:mtalk.google.com,
domain:mxhichina.com,
domain:myqcloud.com,
domain:myunlu.com,
domain:netease.com,
domain:nfoservers.com,
domain:nssurge.com,
domain:nuomi.com,
domain:ourdvs.com,
domain:overcast.fm,
domain:paypal.com,
domain:paypalobjects.com,
domain:pgyer.com,
domain:qdaily.com,
domain:qdmm.com,
domain:qin.io,
domain:qingmang.me,
domain:qingmang.mobi,
domain:qqurl.com,
domain:rarbg.to,
domain:rrmj.tv,
domain:ruguoapp.com,
domain:sm.ms,
domain:snwx.com,
domain:soku.com,
domain:startssl.com,
domain:store.steampowered.com,
domain:symcd.com,
domain:teamviewer.com,
domain:tmzvps.com,
domain:trello.com,
domain:trellocdn.com,
domain:ttmeiju.com,
domain:udache.com,
domain:uxengine.net,
domain:weather.bjango.com,
domain:weather.com,
domain:webqxs.com,
domain:weico.cc,
domain:wenku8.net,
domain:werewolf.53site.com,
domain:windowsupdate.com,
domain:wkcdn.com,
domain:workflowy.com,
domain:xdrig.com,
domain:xiaojukeji.com,
domain:xiaomi.net,
domain:xiaomicp.com,
domain:ximalaya.com,
domain:xitek.com,
domain:xmcdn.com,
domain:xslb.net,
domain:xteko.com,
domain:yach.me,
domain:yixia.com,
domain:yunjiasu-cdn.net,
domain:zealer.com,
domain:zgslb.net,
domain:zimuzu.tv,
domain:zmz002.com,
domain:samsungdm.com,
-33
View File
@@ -1,33 +0,0 @@
geosite:google,
geosite:github,
geosite:netflix,
geosite:steam,
geosite:telegram,
geosite:tumblr,
geosite:speedtest,
geosite:bbc,
domain:gvt1.com,
domain:textnow.com,
domain:twitch.tv,
domain:wikileaks.org,
domain:naver.com,
91.108.4.0/22,
91.108.8.0/22,
91.108.12.0/22,
91.108.20.0/22,
91.108.36.0/23,
91.108.38.0/23,
91.108.56.0/22,
149.154.160.0/20,
149.154.164.0/22,
149.154.172.0/22,
74.125.0.0/16,
173.194.0.0/16,
172.217.0.0/16,
216.58.200.0/24,
216.58.220.0/24,
91.108.56.116,
91.108.56.0/24,
109.239.140.0/24,
149.154.167.0/24,
149.154.175.0/24,
@@ -2,7 +2,7 @@
using System.IO;
using System.Linq;
namespace v2rayN.Base
namespace v2rayN
{
static class StringEx
{
+9 -1
View File
@@ -18,7 +18,6 @@ using ZXing;
using ZXing.Common;
using ZXing.QrCode;
using System.Security.Principal;
using v2rayN.Base;
namespace v2rayN
{
@@ -443,6 +442,15 @@ namespace v2rayN
return Regex.IsMatch(input, pattern, RegexOptions.IgnoreCase);
}
public static bool IsIdenticalServer(Mode.ServerStatistics a, Mode.ServerStatistics b)
{
return (a.address == b.address
&& a.port == b.port
&& a.path == b.path
&& a.host == b.host
);
}
#endregion
#region 开机自动启动
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Grpc.Tools" version="2.24.0" targetFramework="net46" developmentDependency="true" />
<package id="Grpc.Tools" version="2.23.0" targetFramework="net46" developmentDependency="true" />
</packages>
+25 -26
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.props" Condition="Exists('..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.props')" />
<Import Project="..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.props" Condition="Exists('..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -114,7 +114,6 @@
<HintPath>LIB\System.Memory.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Messaging" />
<Reference Include="System.Net" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -141,7 +140,7 @@
<Compile Include="Forms\AddServer4Form.Designer.cs">
<DependentUpon>AddServer4Form.cs</DependentUpon>
</Compile>
<Compile Include="Base\ListViewFlickerFree.cs">
<Compile Include="Forms\ListViewFlickerFree.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\MainForm.cs">
@@ -180,30 +179,24 @@
<Compile Include="Forms\SubSettingControl.Designer.cs">
<DependentUpon>SubSettingControl.cs</DependentUpon>
</Compile>
<Compile Include="Handler\MainFormHandler.cs" />
<Compile Include="Handler\SpeedtestHandler.cs" />
<Compile Include="Handler\StatisticsHandler.cs" />
<Compile Include="Handler\DownloadHandle.cs" />
<Compile Include="Base\HttpWebServer.cs" />
<Compile Include="Base\HttpWebServerB.cs" />
<Compile Include="Handler\V2rayUpdateHandle.cs" />
<Compile Include="HttpProxyHandler\HttpWebServer.cs" />
<Compile Include="HttpProxyHandler\HttpWebServerB.cs" />
<Compile Include="HttpProxyHandler\PACFileWatcherHandle.cs" />
<Compile Include="HttpProxyHandler\PrivoxyHandler.cs" />
<Compile Include="HttpProxyHandler\PACListHandle.cs" />
<Compile Include="HttpProxyHandler\PACServerHandle.cs" />
<Compile Include="HttpProxyHandler\ProxySetting.cs" />
<Compile Include="HttpProxyHandler\SysProxyHandle.cs" />
<Compile Include="HttpProxyHandler\HttpProxyHandle.cs" />
<Compile Include="Base\WebClientEx.cs">
<Compile Include="HttpProxyHandler\WebClientEx.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Mode\EMove.cs" />
<Compile Include="Mode\ServerStatistics.cs" />
<Compile Include="Mode\SysproxyConfig.cs" />
<Compile Include="Mode\EConfigType.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Resx\ResUI.zh-Hans.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -214,7 +207,7 @@
<DesignTime>True</DesignTime>
<DependentUpon>ResUI.resx</DependentUpon>
</Compile>
<Compile Include="Base\StringEx.cs">
<Compile Include="StringEx.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Forms\AddServerForm.cs">
@@ -325,9 +318,14 @@
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="app.config">
<SubType>Designer</SubType>
</EmbeddedResource>
@@ -341,13 +339,8 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Sample\custom_routing_block" />
<EmbeddedResource Include="Sample\custom_routing_direct" />
<EmbeddedResource Include="Sample\custom_routing_proxy" />
<Protobuf Include="Protos\Statistics.proto" />
<None Include="Resources\abp.js.gz" />
<None Include="Resources\grpc_csharp_ext.x64.dll.gz" />
<None Include="Resources\grpc_csharp_ext.x86.dll.gz" />
<None Include="Resources\pac.txt.gz" />
<None Include="Resources\sysproxy.exe.gz" />
<None Include="Resources\sysproxy64.exe.gz" />
@@ -398,6 +391,7 @@
<EmbeddedResource Include="Sample\SampleServerConfig.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\mgwz.dll.gz" />
<None Include="Resources\privoxy.exe.gz" />
<None Include="Resources\restart.png" />
</ItemGroup>
@@ -425,9 +419,14 @@
<EmbeddedResource Include="LIB\System.Runtime.CompilerServices.Unsafe.dll" />
<EmbeddedResource Include="LIB\zxing.dll" />
<EmbeddedResource Include="LIB\zxing.presentation.dll" />
<Content Include="grpc_csharp_ext.x64.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="grpc_csharp_ext.x86.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="LIB\netstandard.dll" />
<Content Include="Resources\help.png" />
<None Include="Resources\notify.png" />
<Content Include="Resources\privoxy_conf.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -438,12 +437,12 @@
<Import Project="..\packages\Grpc.Core.2.23.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.2.23.0\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.props'))" />
<Error Condition="!Exists('..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.targets'))" />
<Error Condition="!Exists('..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.props'))" />
<Error Condition="!Exists('..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.targets'))" />
</Target>
<Import Project="..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.targets" Condition="Exists('..\packages\Grpc.Tools.2.24.0\build\Grpc.Tools.targets')" />
<Import Project="..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.targets" Condition="Exists('..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">