Compare commits

..

52 Commits

Author SHA1 Message Date
2dust 5566df791c up spac 2019-12-24 09:33:23 +08:00
2dust 1ca416bacf Update AssemblyInfo.cs 2019-12-24 09:01:17 +08:00
2dust 97d7229974 Update V2rayHandler.cs 2019-12-24 09:01:13 +08:00
2dust 6a0bfc43dd Update Global.cs 2019-12-24 09:01:10 +08:00
2dust 732da0c330 Update libs.zip 2019-12-18 13:13:06 +08:00
2dust 012bb5654b Update MainForm.cs 2019-12-18 13:13:00 +08:00
2dust 068fe3113b up test 2019-12-17 16:16:47 +08:00
2dust 4a74102eb7 Update ProxySetting.cs 2019-12-17 09:14:31 +08:00
2dust b310cfeda2 Update ProxySetting.cs 2019-12-16 20:04:58 +08:00
2dust 07cd855446 Update DownloadHandle.cs 2019-12-16 17:16:27 +08:00
2dust ab08660c20 Update AssemblyInfo.cs 2019-12-16 14:26:23 +08:00
2dust daf271ee0d Merge branch 'master' of https://github.com/2dust/v2rayN 2019-12-16 10:24:32 +08:00
2dust f949c9f4f0 Update Global.cs 2019-12-16 10:24:29 +08:00
2dust a609eb4bcf Update issue_template.md 2019-12-16 09:12:02 +08:00
2dust fd9b6d0ff0 up ui 2019-12-16 09:10:01 +08:00
2dust cb074528f4 up pac 2019-12-13 09:49:17 +08:00
2dust 5cadf59e10 add up 2019-12-12 10:16:09 +08:00
2dust 86229bf73b add upgrade 2019-12-12 10:04:12 +08:00
2dust cf04c64fee user pac rules 2019-12-11 13:36:05 +08:00
2dust f8517a316b up newline 2019-12-11 11:42:41 +08:00
2dust 8bcbd34c27 up job 2019-12-11 10:25:28 +08:00
2dust 3e35882fee add ieproxy 2019-12-10 11:22:13 +08:00
2dust cf204fac39 add libs 2019-12-10 11:21:39 +08:00
2dust dfc22258dd remove res 2019-12-10 11:11:27 +08:00
2dust b7ac195bfc Merge pull request #293 from kotori2/master
Fix encoding issue
2019-12-06 16:54:47 +08:00
双草酸酯 45c74cfe59 Fix encoding issue 2019-12-05 17:29:43 +08:00
2dust fe15fde594 up pp 2019-12-02 13:47:13 +08:00
2dust ec312055be Update AssemblyInfo.cs 2019-11-27 13:57:51 +08:00
2dust b08a0212ff Update DownloadHandle.cs 2019-11-27 13:15:02 +08:00
2dust 3f1688f8b7 up stat 2019-11-25 13:22:35 +08:00
2dust 912f682359 Update AssemblyInfo.cs 2019-11-14 10:37:10 +08:00
2dust 1a84090cc7 cleanup http 2019-11-13 11:33:47 +08:00
2dust 70dadf9964 up routing 2019-11-08 17:30:48 +08:00
2dust 9eab95e870 up test 2019-11-02 11:07:31 +08:00
2dust f199e3bf82 Update AssemblyInfo.cs 2019-10-30 14:20:12 +08:00
2dust 7d31c2e472 up addr 2019-10-30 14:07:26 +08:00
2dust ad406c3682 Update SpeedtestHandler.cs 2019-10-28 13:11:14 +08:00
2dust 2779670fa2 up speedtest 2019-10-27 12:55:20 +08:00
2dust 5b00bf82fb Update MainForm.cs 2019-10-24 08:42:55 +08:00
2dust 473e0cf839 Update HttpWebServerB.cs 2019-10-24 08:23:32 +08:00
2dust ef01b4aa5e fix pac 2019-10-23 15:18:21 +08:00
2dust c0340843eb up pac 2019-10-22 17:04:11 +08:00
2dust e6ca25462e clean 2019-10-21 14:17:28 +08:00
2dust 53494341fc Update AssemblyInfo.cs 2019-10-21 10:38:15 +08:00
2dust 5aee97320b up speedtest 2019-10-21 10:35:54 +08:00
2dust d5c69c7838 Clean code 2019-10-18 14:49:42 +08:00
2dust 9224ea9819 up webproxy 2019-10-17 13:29:58 +08:00
2dust a922d3c46d Update SysProxyHandle.cs 2019-10-17 11:00:36 +08:00
2dust b94d10d808 up speedtest 2019-10-17 09:41:46 +08:00
2dust fe0bd5938b Update OptionSettingForm.cs 2019-10-12 09:06:57 +08:00
2dust 0091a58796 Update OptionSettingForm.resx 2019-10-12 09:06:54 +08:00
2dust 8bbb50ceb2 mge 2019-10-11 14:15:20 +08:00
96 changed files with 5649 additions and 4170 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
在提出问题前请先自行排除服务器端问题,同时也请通过搜索确认是否有人提出过相同问题。
在提出问题前请先自行排除服务器端问题和升级到最新客户端,同时也请通过搜索确认是否有人提出过相同问题。
### 预期行为
描述你认为应该发生什么
@@ -19,7 +19,7 @@
```
</details>
### 环境信息
### 环境信息(客户端请升级至最新正式版)
### 额外信息(可选)
+6 -1
View File
@@ -2,13 +2,18 @@
# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。
################################################################################
/v2rayN/.vs/v2rayN/v15
/v2rayN/.vs/
/v2rayN/v2rayN/bin/Debug/app.publish
/v2rayN/v2rayN/bin/Debug
/v2rayN/v2rayN/obj/Debug
/v2rayN/.vs/v2rayN/DesignTimeBuild
/v2rayN/v2rayN/bin/Release
/v2rayN/v2rayN/obj/Release
/v2rayN/packages
.vs/ProjectSettings.json
.vs/slnx.sqlite
.vs/VSWorkspaceState.json
/v2rayN/v2rayUpgrade/bin/Debug
/v2rayN/v2rayUpgrade/obj/Debug
/v2rayN/v2rayUpgrade/bin/Release
/v2rayN/v2rayUpgrade/obj/Release
+10
View File
@@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.28010.2050
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "v2rayN", "v2rayN\v2rayN.csproj", "{0A9785E6-D256-4B73-9757-4EF59955FD1E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "v2rayUpgrade", "v2rayUpgrade\v2rayUpgrade.csproj", "{F82BE52A-155C-492C-9E0A-1E917EC62C78}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -20,6 +22,14 @@ Global
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|Any CPU.Build.0 = Release|Any CPU
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|x86.ActiveCfg = Release|Any CPU
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|x86.ActiveCfg = Debug|Any CPU
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|x86.Build.0 = Debug|Any CPU
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|Any CPU.Build.0 = Release|Any CPU
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|x86.ActiveCfg = Release|Any CPU
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -3,14 +3,14 @@ using System.Net;
using System.Text;
using System.Threading;
namespace v2rayN.HttpProxyHandler
namespace v2rayN.Base
{
public class HttpWebServer
{
private HttpListener _listener;
private Func<HttpListenerRequest, string> _responderMethod;
private Func<string, string> _responderMethod;
public HttpWebServer(string[] prefixes, Func<HttpListenerRequest, string> method)
public HttpWebServer(string[] prefixes, Func<string, string> method)
{
try
{
@@ -39,10 +39,11 @@ namespace v2rayN.HttpProxyHandler
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
throw;
}
}
public HttpWebServer(Func<HttpListenerRequest, string> method, params string[] prefixes)
public HttpWebServer(Func<string, string> method, params string[] prefixes)
: this(prefixes, method) { }
public void Run()
@@ -59,7 +60,9 @@ namespace v2rayN.HttpProxyHandler
var ctx = c as HttpListenerContext;
try
{
string rstr = _responderMethod(ctx.Request);
string address = ctx.Request.LocalEndPoint.Address.ToString();
Utils.SaveLog("Webserver Request " + address);
string rstr = _responderMethod(address);
byte[] buf = Encoding.UTF8.GetBytes(rstr);
ctx.Response.StatusCode = 200;
ctx.Response.ContentType = "application/x-ns-proxy-autoconfig";
+130
View File
@@ -0,0 +1,130 @@
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();
}
}
}
+56
View File
@@ -0,0 +1,56 @@
using System.Drawing;
using System.Windows.Forms;
namespace v2rayN.Base
{
class ListViewFlickerFree : ListView
{
public ListViewFlickerFree()
{
SetStyle(ControlStyles.OptimizedDoubleBuffer
| ControlStyles.AllPaintingInWmPaint
, true);
UpdateStyles();
}
public void AutoResizeColumns()
{
try
{
int count = this.Columns.Count;
int MaxWidth = 0;
Graphics graphics = this.CreateGraphics();
Font font = this.Font;
ListView.ListViewItemCollection items = this.Items;
string str;
int width;
this.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
for (int i = 0; i < count; i++)
{
str = this.Columns[i].Text;
MaxWidth = this.Columns[i].Width;
foreach (ListViewItem item in items)
{
str = item.SubItems[i].Text;
width = (int)graphics.MeasureString(str, font).Width;
if (width > MaxWidth)
{
MaxWidth = width;
}
}
if (i == 0)
{
this.Columns[i].Width = MaxWidth;
}
this.Columns[i].Width = MaxWidth;
}
}
catch { }
}
}
}
@@ -2,7 +2,7 @@
using System.IO;
using System.Linq;
namespace v2rayN
namespace v2rayN.Base
{
static class StringEx
{
@@ -43,5 +43,10 @@ namespace v2rayN
yield return line;
}
}
public static string TrimEx(this string value)
{
return value == null ? string.Empty : value.Trim();
}
}
}
+47
View File
@@ -0,0 +1,47 @@
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,5 +35,6 @@ namespace v2rayN.Forms
Utils.SaveLog($"Loading custom icon failed: {e.Message}");
}
}
}
}
+81 -34
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 System.Windows.Forms.ListView();
this.lvServers = new v2rayN.Base.ListViewFlickerFree();
this.cmsLv = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuAddVmessServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddShadowsocksServer = new System.Windows.Forms.ToolStripMenuItem();
@@ -41,6 +41,7 @@
this.menuScanScreen = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.menuRemoveServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuRemoveDuplicateServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuCopyServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuSetDefaultServer = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
@@ -51,6 +52,8 @@
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();
@@ -61,8 +64,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();
@@ -73,7 +76,6 @@
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();
@@ -82,10 +84,14 @@
this.toolSslSocksPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslSocksPort = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslHttpPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslHttpPort = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslPacPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslPacPort = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank3 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslServerSpeed = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank4 = new System.Windows.Forms.ToolStripStatusLabel();
this.panel1 = new System.Windows.Forms.Panel();
this.tsMain = new System.Windows.Forms.ToolStrip();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
@@ -111,8 +117,7 @@
this.tsbPromotion = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
this.tsbClose = new System.Windows.Forms.ToolStripButton();
this.toolSslHttpPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslPacPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -147,6 +152,7 @@
this.lvServers.FullRowSelect = true;
this.lvServers.GridLines = true;
this.lvServers.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.lvServers.HideSelection = false;
this.lvServers.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
((System.Windows.Forms.ListViewItem)(resources.GetObject("lvServers.Items")))});
this.lvServers.MultiSelect = false;
@@ -154,6 +160,7 @@
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);
//
@@ -169,6 +176,7 @@
this.menuScanScreen,
this.toolStripSeparator1,
this.menuRemoveServer,
this.menuRemoveDuplicateServer,
this.menuCopyServer,
this.menuSetDefaultServer,
this.toolStripSeparator3,
@@ -179,6 +187,8 @@
this.menuSelectAll,
this.toolStripSeparator9,
this.menuPingServer,
this.menuTcpingServer,
this.menuRealPingServer,
this.menuSpeedServer,
this.toolStripSeparator6,
this.menuExport2ClientConfig,
@@ -236,6 +246,12 @@
resources.ApplyResources(this.menuRemoveServer, "menuRemoveServer");
this.menuRemoveServer.Click += new System.EventHandler(this.menuRemoveServer_Click);
//
// menuRemoveDuplicateServer
//
this.menuRemoveDuplicateServer.Name = "menuRemoveDuplicateServer";
resources.ApplyResources(this.menuRemoveDuplicateServer, "menuRemoveDuplicateServer");
this.menuRemoveDuplicateServer.Click += new System.EventHandler(this.menuRemoveDuplicateServer_Click);
//
// menuCopyServer
//
this.menuCopyServer.Name = "menuCopyServer";
@@ -294,6 +310,18 @@
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";
@@ -352,7 +380,6 @@
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,
@@ -365,15 +392,10 @@
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,
@@ -381,6 +403,12 @@
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";
@@ -439,12 +467,6 @@
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;
@@ -486,15 +508,17 @@
this.toolSslBlank2,
this.toolSslPacPortLab,
this.toolSslPacPort,
this.toolSslBlank3});
this.toolSslBlank3,
this.toolSslServerSpeed,
this.toolSslBlank4});
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.Name = "ssMain";
this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked);
//
// toolSslSocksPortLab
//
this.toolSslSocksPortLab.Name = "toolSslSocksPortLab";
resources.ApplyResources(this.toolSslSocksPortLab, "toolSslSocksPortLab");
this.toolSslSocksPortLab.Name = "toolSslSocksPortLab";
//
// toolSslSocksPort
//
@@ -503,10 +527,15 @@
//
// toolSslBlank1
//
this.toolSslBlank1.Name = "toolSslBlank1";
resources.ApplyResources(this.toolSslBlank1, "toolSslBlank1");
this.toolSslBlank1.Name = "toolSslBlank1";
this.toolSslBlank1.Spring = true;
//
// toolSslHttpPortLab
//
resources.ApplyResources(this.toolSslHttpPortLab, "toolSslHttpPortLab");
this.toolSslHttpPortLab.Name = "toolSslHttpPortLab";
//
// toolSslHttpPort
//
this.toolSslHttpPort.Name = "toolSslHttpPort";
@@ -514,10 +543,15 @@
//
// toolSslBlank2
//
this.toolSslBlank2.Name = "toolSslBlank2";
resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
this.toolSslBlank2.Name = "toolSslBlank2";
this.toolSslBlank2.Spring = true;
//
// toolSslPacPortLab
//
resources.ApplyResources(this.toolSslPacPortLab, "toolSslPacPortLab");
this.toolSslPacPortLab.Name = "toolSslPacPortLab";
//
// toolSslPacPort
//
this.toolSslPacPort.Name = "toolSslPacPort";
@@ -525,10 +559,21 @@
//
// toolSslBlank3
//
this.toolSslBlank3.Name = "toolSslBlank3";
resources.ApplyResources(this.toolSslBlank3, "toolSslBlank3");
this.toolSslBlank3.Name = "toolSslBlank3";
this.toolSslBlank3.Spring = true;
//
// toolSslServerSpeed
//
resources.ApplyResources(this.toolSslServerSpeed, "toolSslServerSpeed");
this.toolSslServerSpeed.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolSslServerSpeed.Name = "toolSslServerSpeed";
//
// toolSslBlank4
//
this.toolSslBlank4.Name = "toolSslBlank4";
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
@@ -615,6 +660,7 @@
this.tsbCheckUpdateN,
this.tsbCheckUpdateCore,
this.tsbCheckUpdatePACList,
this.toolStripSeparator13,
this.tsbCheckClearPACList});
this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate;
resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate");
@@ -702,15 +748,10 @@
this.tsbClose.Name = "tsbClose";
this.tsbClose.Click += new System.EventHandler(this.tsbClose_Click);
//
// toolSslHttpPortLab
// toolStripSeparator13
//
this.toolSslHttpPortLab.Name = "toolSslHttpPortLab";
resources.ApplyResources(this.toolSslHttpPortLab, "toolSslHttpPortLab");
//
// toolSslPacPortLab
//
this.toolSslPacPortLab.Name = "toolSslPacPortLab";
resources.ApplyResources(this.toolSslPacPortLab, "toolSslPacPortLab");
this.toolStripSeparator13.Name = "toolStripSeparator13";
resources.ApplyResources(this.toolStripSeparator13, "toolStripSeparator13");
//
// MainForm
//
@@ -726,6 +767,7 @@
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
this.Load += new System.EventHandler(this.MainForm_Load);
this.Shown += new System.EventHandler(this.MainForm_Shown);
this.VisibleChanged += new System.EventHandler(this.MainForm_VisibleChanged);
this.Resize += new System.EventHandler(this.MainForm_Resize);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
@@ -750,14 +792,13 @@
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtMsgBox;
private System.Windows.Forms.ListView lvServers;
private v2rayN.Base.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;
@@ -785,7 +826,6 @@
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;
@@ -830,6 +870,13 @@
private System.Windows.Forms.ToolStripStatusLabel toolSslSocksPortLab;
private System.Windows.Forms.ToolStripStatusLabel toolSslHttpPortLab;
private System.Windows.Forms.ToolStripStatusLabel toolSslPacPortLab;
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;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
}
}
File diff suppressed because it is too large Load Diff
+296 -182
View File
@@ -173,6 +173,12 @@
<data name="menuRemoveServer.Text" xml:space="preserve">
<value>Remove selected server (multiple choice) (Delete)</value>
</data>
<data name="menuRemoveDuplicateServer.Size" type="System.Drawing.Size, System.Drawing">
<value>447, 22</value>
</data>
<data name="menuRemoveDuplicateServer.Text" xml:space="preserve">
<value>Remove duplicate server</value>
</data>
<data name="menuCopyServer.Size" type="System.Drawing.Size, System.Drawing">
<value>447, 22</value>
</data>
@@ -225,13 +231,25 @@
<value>447, 22</value>
</data>
<data name="menuPingServer.Text" xml:space="preserve">
<value>Test server delay (multiple choice)</value>
<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>
</data>
<data name="menuSpeedServer.Size" type="System.Drawing.Size, System.Drawing">
<value>447, 22</value>
</data>
<data name="menuSpeedServer.Text" xml:space="preserve">
<value>Test server speed (multiple choice)</value>
<value>Test server speed (multiple choice)(Ctrl+T)</value>
</data>
<data name="toolStripSeparator6.Size" type="System.Drawing.Size, System.Drawing">
<value>444, 6</value>
@@ -273,7 +291,7 @@
<value>ImageAboveText</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>448, 468</value>
<value>448, 534</value>
</data>
<data name="&gt;&gt;cmsLv.Name" xml:space="preserve">
<value>cmsLv</value>
@@ -305,7 +323,7 @@
<value>0, 0</value>
</data>
<data name="lvServers.Size" type="System.Drawing.Size, System.Drawing">
<value>726, 331</value>
<value>686, 331</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="lvServers.TabIndex" type="System.Int32, mscorlib">
@@ -315,7 +333,7 @@
<value>lvServers</value>
</data>
<data name="&gt;&gt;lvServers.Type" xml:space="preserve">
<value>System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>v2rayN.Base.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>
@@ -375,10 +393,10 @@
<value>100</value>
</data>
<data name="splitContainer1.Size" type="System.Drawing.Size, System.Drawing">
<value>986, 331</value>
<value>946, 331</value>
</data>
<data name="splitContainer1.SplitterDistance" type="System.Int32, mscorlib">
<value>726</value>
<value>686</value>
</data>
<data name="splitContainer1.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@@ -405,7 +423,7 @@
<value>NoControl</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>265, 164</value>
<value>265, 142</value>
</data>
<data name="&gt;&gt;cmsMain.Name" xml:space="preserve">
<value>cmsMain</value>
@@ -419,17 +437,17 @@
<data name="notifyMain.Visible" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="menuSysAgentEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value>
</data>
<data name="menuSysAgentEnabled.Text" xml:space="preserve">
<value>Enable Http proxy</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>264, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http proxy mode</value>
<value>Http proxy</value>
</data>
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 22</value>
</data>
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
<value>Not Enabled Http Proxy</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 22</value>
@@ -488,9 +506,6 @@
<data name="menuExit.Text" xml:space="preserve">
<value>Exit</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>
@@ -501,7 +516,7 @@
<value>0, 66</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>992, 351</value>
<value>952, 351</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@@ -521,27 +536,9 @@
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="txtMsgBox.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtMsgBox.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtMsgBox.MaxLength" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="txtMsgBox.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtMsgBox.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Vertical</value>
</data>
<data name="txtMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>986, 134</value>
</data>
<data name="txtMsgBox.TabIndex" type="System.Int32, mscorlib">
<value>2</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>
</metadata>
<data name="&gt;&gt;txtMsgBox.Name" xml:space="preserve">
<value>txtMsgBox</value>
</data>
@@ -554,57 +551,6 @@
<data name="&gt;&gt;txtMsgBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>603, 17</value>
</metadata>
<data name="toolSslSocksPortLab.Size" type="System.Drawing.Size, System.Drawing">
<value>55, 17</value>
</data>
<data name="toolSslSocksPortLab.Text" xml:space="preserve">
<value>SOCKS5</value>
</data>
<data name="toolSslSocksPort.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>238, 17</value>
</data>
<data name="toolSslHttpPortLab.Size" type="System.Drawing.Size, System.Drawing">
<value>38, 17</value>
</data>
<data name="toolSslHttpPortLab.Text" xml:space="preserve">
<value>HTTP</value>
</data>
<data name="toolSslHttpPort.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>238, 17</value>
</data>
<data name="toolSslPacPortLab.Size" type="System.Drawing.Size, System.Drawing">
<value>31, 17</value>
</data>
<data name="toolSslPacPortLab.Text" xml:space="preserve">
<value>PAC</value>
</data>
<data name="toolSslPacPort.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="toolSslBlank3.Size" type="System.Drawing.Size, System.Drawing">
<value>238, 17</value>
</data>
<data name="ssMain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 151</value>
</data>
<data name="ssMain.Size" type="System.Drawing.Size, System.Drawing">
<value>986, 22</value>
</data>
<data name="ssMain.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="ssMain.Text" xml:space="preserve">
<value>statusStrip1</value>
</data>
<data name="&gt;&gt;ssMain.Name" xml:space="preserve">
<value>ssMain</value>
</data>
@@ -624,7 +570,7 @@
<value>0, 417</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>992, 176</value>
<value>952, 176</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
@@ -644,6 +590,141 @@
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="txtMsgBox.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtMsgBox.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtMsgBox.MaxLength" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="txtMsgBox.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtMsgBox.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Vertical</value>
</data>
<data name="txtMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>946, 134</value>
</data>
<data name="txtMsgBox.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="&gt;&gt;txtMsgBox.Name" xml:space="preserve">
<value>txtMsgBox</value>
</data>
<data name="&gt;&gt;txtMsgBox.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;txtMsgBox.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;txtMsgBox.ZOrder" xml:space="preserve">
<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>
</metadata>
<data name="ssMain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 151</value>
</data>
<data name="ssMain.Size" type="System.Drawing.Size, System.Drawing">
<value>946, 22</value>
</data>
<data name="ssMain.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="ssMain.Text" xml:space="preserve">
<value>statusStrip1</value>
</data>
<data name="&gt;&gt;ssMain.Name" xml:space="preserve">
<value>ssMain</value>
</data>
<data name="&gt;&gt;ssMain.Type" xml:space="preserve">
<value>System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;ssMain.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;ssMain.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="toolSslSocksPortLab.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslSocksPortLab.Size" type="System.Drawing.Size, System.Drawing">
<value>49, 17</value>
</data>
<data name="toolSslSocksPortLab.Text" xml:space="preserve">
<value>SOCKS5</value>
</data>
<data name="toolSslSocksPort.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="toolSslBlank1.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 17</value>
</data>
<data name="toolSslHttpPortLab.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslHttpPortLab.Size" type="System.Drawing.Size, System.Drawing">
<value>36, 17</value>
</data>
<data name="toolSslHttpPortLab.Text" xml:space="preserve">
<value>HTTP</value>
</data>
<data name="toolSslHttpPort.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="toolSslBlank2.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 17</value>
</data>
<data name="toolSslPacPortLab.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslPacPortLab.Size" type="System.Drawing.Size, System.Drawing">
<value>30, 17</value>
</data>
<data name="toolSslPacPortLab.Text" xml:space="preserve">
<value>PAC</value>
</data>
<data name="toolSslPacPort.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="toolSslBlank3.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslBlank3.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 17</value>
</data>
<data name="toolSslServerSpeed.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="toolSslServerSpeed.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslServerSpeed.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>No</value>
</data>
<data name="toolSslServerSpeed.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 17</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>SPEED Disabled</value>
</data>
<data name="toolSslServerSpeed.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleRight</value>
</data>
<data name="toolSslBlank4.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 17</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
@@ -651,7 +732,7 @@
<value>0, 56</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>992, 10</value>
<value>952, 10</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
@@ -671,27 +752,6 @@
<metadata name="tsMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>409, 17</value>
</metadata>
<data name="tsMain.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="tsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>992, 56</value>
</data>
<data name="tsMain.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;tsMain.Name" xml:space="preserve">
<value>tsMain</value>
</data>
<data name="&gt;&gt;tsMain.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tsMain.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;tsMain.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="toolStripSeparator4.Size" type="System.Drawing.Size, System.Drawing">
<value>6, 56</value>
</data>
@@ -707,18 +767,6 @@
<data name="tsbSub.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<value>ImageAboveText</value>
</data>
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>197, 22</value>
</data>
<data name="tsbSubSetting.Text" xml:space="preserve">
<value>Subscription settings</value>
</data>
<data name="tsbSubUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>197, 22</value>
</data>
<data name="tsbSubUpdate.Text" xml:space="preserve">
<value>Update subscription</value>
</data>
<data name="toolStripSeparator8.Size" type="System.Drawing.Size, System.Drawing">
<value>6, 56</value>
</data>
@@ -766,18 +814,6 @@
<data name="toolStripSeparator7.Size" type="System.Drawing.Size, System.Drawing">
<value>6, 56</value>
</data>
<data name="tsbCheckUpdate.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>128, 53</value>
</data>
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value>Check for updates</value>
</data>
<data name="tsbCheckUpdate.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<value>ImageAboveText</value>
</data>
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
<value>338, 22</value>
</data>
@@ -796,12 +832,27 @@
<data name="tsbCheckUpdatePACList.Text" xml:space="preserve">
<value>Check for updated PAC (requires Http proxy)</value>
</data>
<data name="toolStripSeparator13.Size" type="System.Drawing.Size, System.Drawing">
<value>335, 6</value>
</data>
<data name="tsbCheckClearPACList.Size" type="System.Drawing.Size, System.Drawing">
<value>338, 22</value>
</data>
<data name="tsbCheckClearPACList.Text" xml:space="preserve">
<value>Simplify PAC (please set Core route)</value>
</data>
<data name="tsbCheckUpdate.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>128, 53</value>
</data>
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value>Check for updates</value>
</data>
<data name="tsbCheckUpdate.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<value>ImageAboveText</value>
</data>
<data name="toolStripSeparator10.Size" type="System.Drawing.Size, System.Drawing">
<value>6, 56</value>
</data>
@@ -817,27 +868,6 @@
<data name="tsbHelp.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<value>ImageAboveText</value>
</data>
<data name="tsbAbout.Size" type="System.Drawing.Size, System.Drawing">
<value>187, 22</value>
</data>
<data name="tsbAbout.Text" xml:space="preserve">
<value>About</value>
</data>
<data name="toolStripSeparator12.Size" type="System.Drawing.Size, System.Drawing">
<value>184, 6</value>
</data>
<data name="tsbLanguageDef.Size" type="System.Drawing.Size, System.Drawing">
<value>187, 22</value>
</data>
<data name="tsbLanguageDef.Text" xml:space="preserve">
<value>Language-[English]</value>
</data>
<data name="tsbLanguageZhHans.Size" type="System.Drawing.Size, System.Drawing">
<value>187, 22</value>
</data>
<data name="tsbLanguageZhHans.Text" xml:space="preserve">
<value>语言-[中文简体]</value>
</data>
<data name="tsbPromotion.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
@@ -872,6 +902,60 @@
<data name="tsbClose.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<value>ImageAboveText</value>
</data>
<data name="tsMain.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="tsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>952, 56</value>
</data>
<data name="tsMain.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;tsMain.Name" xml:space="preserve">
<value>tsMain</value>
</data>
<data name="&gt;&gt;tsMain.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tsMain.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;tsMain.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>197, 22</value>
</data>
<data name="tsbSubSetting.Text" xml:space="preserve">
<value>Subscription settings</value>
</data>
<data name="tsbSubUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>197, 22</value>
</data>
<data name="tsbSubUpdate.Text" xml:space="preserve">
<value>Update subscription</value>
</data>
<data name="tsbAbout.Size" type="System.Drawing.Size, System.Drawing">
<value>187, 22</value>
</data>
<data name="tsbAbout.Text" xml:space="preserve">
<value>About</value>
</data>
<data name="toolStripSeparator12.Size" type="System.Drawing.Size, System.Drawing">
<value>184, 6</value>
</data>
<data name="tsbLanguageDef.Size" type="System.Drawing.Size, System.Drawing">
<value>187, 22</value>
</data>
<data name="tsbLanguageDef.Text" xml:space="preserve">
<value>Language-[English]</value>
</data>
<data name="tsbLanguageZhHans.Size" type="System.Drawing.Size, System.Drawing">
<value>187, 22</value>
</data>
<data name="tsbLanguageZhHans.Text" xml:space="preserve">
<value>语言-[中文简体]</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -882,7 +966,7 @@
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>992, 593</value>
<value>952, 593</value>
</data>
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
@@ -938,6 +1022,12 @@
<data name="&gt;&gt;menuRemoveServer.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;menuRemoveDuplicateServer.Name" xml:space="preserve">
<value>menuRemoveDuplicateServer</value>
</data>
<data name="&gt;&gt;menuRemoveDuplicateServer.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;menuCopyServer.Name" xml:space="preserve">
<value>menuCopyServer</value>
</data>
@@ -998,6 +1088,18 @@
<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>
@@ -1046,18 +1148,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>
@@ -1118,12 +1220,6 @@
<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>
@@ -1148,6 +1244,12 @@
<data name="&gt;&gt;toolSslBlank1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslHttpPortLab.Name" xml:space="preserve">
<value>toolSslHttpPortLab</value>
</data>
<data name="&gt;&gt;toolSslHttpPortLab.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslHttpPort.Name" xml:space="preserve">
<value>toolSslHttpPort</value>
</data>
@@ -1160,6 +1262,12 @@
<data name="&gt;&gt;toolSslBlank2.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslPacPortLab.Name" xml:space="preserve">
<value>toolSslPacPortLab</value>
</data>
<data name="&gt;&gt;toolSslPacPortLab.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslPacPort.Name" xml:space="preserve">
<value>toolSslPacPort</value>
</data>
@@ -1172,6 +1280,18 @@
<data name="&gt;&gt;toolSslBlank3.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslServerSpeed.Name" xml:space="preserve">
<value>toolSslServerSpeed</value>
</data>
<data name="&gt;&gt;toolSslServerSpeed.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslBlank4.Name" xml:space="preserve">
<value>toolSslBlank4</value>
</data>
<data name="&gt;&gt;toolSslBlank4.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripSeparator4.Name" xml:space="preserve">
<value>toolStripSeparator4</value>
</data>
@@ -1310,17 +1430,11 @@
<data name="&gt;&gt;tsbClose.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslHttpPortLab.Name" xml:space="preserve">
<value>toolSslHttpPortLab</value>
<data name="&gt;&gt;toolStripSeparator13.Name" xml:space="preserve">
<value>toolStripSeparator13</value>
</data>
<data name="&gt;&gt;toolSslHttpPortLab.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolSslPacPortLab.Name" xml:space="preserve">
<value>toolSslPacPortLab</value>
</data>
<data name="&gt;&gt;toolSslPacPortLab.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="&gt;&gt;toolStripSeparator13.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>MainForm</value>
+57 -36
View File
@@ -119,133 +119,151 @@
</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>252, 22</value>
<value>278, 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>252, 22</value>
<value>278, 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>252, 22</value>
<value>278, 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>252, 22</value>
<value>278, 22</value>
</data>
<data name="menuAddCustomServer.Text" xml:space="preserve">
<value>添加自定义配置服务器</value>
</data>
<data name="menuAddServers.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 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>252, 22</value>
<value>278, 22</value>
</data>
<data name="menuScanScreen.Text" xml:space="preserve">
<value>扫描屏幕上的二维码</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>249, 6</value>
<value>275, 6</value>
</data>
<data name="menuRemoveServer.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 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>
</data>
<data name="menuRemoveDuplicateServer.Text" xml:space="preserve">
<value>移除重复的服务器</value>
</data>
<data name="menuCopyServer.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 22</value>
</data>
<data name="menuCopyServer.Text" xml:space="preserve">
<value>复制所选服务器</value>
</data>
<data name="menuSetDefaultServer.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 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>249, 6</value>
<value>275, 6</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 22</value>
</data>
<data name="menuMoveTop.Text" xml:space="preserve">
<value>上移至顶</value>
</data>
<data name="menuMoveUp.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 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>252, 22</value>
<value>278, 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>252, 22</value>
<value>278, 22</value>
</data>
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>下移至底</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 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>249, 6</value>
<value>275, 6</value>
</data>
<data name="menuPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 22</value>
</data>
<data name="menuPingServer.Text" xml:space="preserve">
<value>测试服务器延迟(多选)</value>
<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>
</data>
<data name="menuSpeedServer.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 22</value>
</data>
<data name="menuSpeedServer.Text" xml:space="preserve">
<value>测试服务器速度(多选)</value>
<value>测试服务器速度(多选)(Ctrl+T)</value>
</data>
<data name="toolStripSeparator6.Size" type="System.Drawing.Size, System.Drawing">
<value>249, 6</value>
<value>275, 6</value>
</data>
<data name="menuExport2ClientConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 22</value>
</data>
<data name="menuExport2ClientConfig.Text" xml:space="preserve">
<value>导出所选服务器为客户端配置</value>
</data>
<data name="menuExport2ServerConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 22</value>
</data>
<data name="menuExport2ServerConfig.Text" xml:space="preserve">
<value>导出所选服务器为服务端配置</value>
</data>
<data name="menuExport2ShareUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 22</value>
<value>278, 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>252, 22</value>
<value>278, 22</value>
</data>
<data name="menuExport2SubContent.Text" xml:space="preserve">
<value>批量导出订阅内容至剪贴板(多选)</value>
@@ -257,7 +275,7 @@
<value> 服务器 </value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>253, 468</value>
<value>279, 534</value>
</data>
<data name="lvServers.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
@@ -276,11 +294,11 @@
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="menuSysAgentEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
<value>340, 22</value>
</data>
<data name="menuSysAgentEnabled.Text" xml:space="preserve">
<value>启用Http代理</value>
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
<value>关闭Http代理</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>340, 22</value>
@@ -310,7 +328,7 @@
<value>195, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http代理模式</value>
<value>Http代理</value>
</data>
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
@@ -346,11 +364,14 @@
<value>退出</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 164</value>
<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>
@@ -381,7 +402,7 @@
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3
@@ -411,7 +432,7 @@
<value>232, 22</value>
</data>
<data name="tsbCheckUpdatePACList.Text" xml:space="preserve">
<value>检查更新PAC (需要Http代理)</value>
<value>检查更新PAC</value>
</data>
<data name="tsbCheckClearPACList.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 22</value>
@@ -443,7 +464,7 @@
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg==
</value>
</data>
+140 -47
View File
@@ -33,6 +33,8 @@
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();
@@ -60,13 +62,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.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
this.labRoutingTips = new System.Windows.Forms.Label();
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
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();
@@ -82,10 +84,17 @@
this.txtKcpmtu = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.cbFreshrate = new System.Windows.Forms.ComboBox();
this.lbFreshrate = 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();
this.label13 = new System.Windows.Forms.Label();
this.chkAutoRun = new System.Windows.Forms.CheckBox();
this.tabPage9 = new System.Windows.Forms.TabPage();
this.txtuserPacRule = new System.Windows.Forms.TextBox();
this.panel4 = new System.Windows.Forms.Panel();
this.label4 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
@@ -98,9 +107,12 @@
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout();
this.tabPage8.SuspendLayout();
this.panel3.SuspendLayout();
this.tabPage6.SuspendLayout();
this.tabPage7.SuspendLayout();
this.tabPage9.SuspendLayout();
this.panel4.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
@@ -118,6 +130,7 @@
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPage9);
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
@@ -131,6 +144,8 @@
//
// 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);
@@ -153,6 +168,24 @@
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");
@@ -289,6 +322,7 @@
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;
@@ -329,50 +363,12 @@
resources.ApplyResources(this.txtUserblock, "txtUserblock");
this.txtUserblock.Name = "txtUserblock";
//
// panel3
// tabPage8
//
this.panel3.Controls.Add(this.btnSetDefRountingRule);
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";
//
// btnSetDefRountingRule
//
resources.ApplyResources(this.btnSetDefRountingRule, "btnSetDefRountingRule");
this.btnSetDefRountingRule.Name = "btnSetDefRountingRule";
this.btnSetDefRountingRule.UseVisualStyleBackColor = true;
this.btnSetDefRountingRule.Click += new System.EventHandler(this.btnSetDefRountingRule_Click);
//
// cmbdomainStrategy
//
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainStrategy.FormattingEnabled = true;
this.cmbdomainStrategy.Items.AddRange(new object[] {
resources.GetString("cmbdomainStrategy.Items"),
resources.GetString("cmbdomainStrategy.Items1"),
resources.GetString("cmbdomainStrategy.Items2")});
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";
this.tabPage8.Controls.Add(this.cmbroutingMode);
resources.ApplyResources(this.tabPage8, "tabPage8");
this.tabPage8.Name = "tabPage8";
this.tabPage8.UseVisualStyleBackColor = true;
//
// cmbroutingMode
//
@@ -386,6 +382,44 @@
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.label15);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3";
//
// btnSetDefRountingRule
//
resources.ApplyResources(this.btnSetDefRountingRule, "btnSetDefRountingRule");
this.btnSetDefRountingRule.Name = "btnSetDefRountingRule";
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;
this.cmbdomainStrategy.FormattingEnabled = true;
this.cmbdomainStrategy.Items.AddRange(new object[] {
resources.GetString("cmbdomainStrategy.Items"),
resources.GetString("cmbdomainStrategy.Items1"),
resources.GetString("cmbdomainStrategy.Items2")});
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
//
// label15
//
resources.ApplyResources(this.label15, "label15");
this.label15.Name = "label15";
//
// tabPage6
//
this.tabPage6.Controls.Add(this.chkKcpcongestion);
@@ -473,6 +507,9 @@
//
// tabPage7
//
this.tabPage7.Controls.Add(this.cbFreshrate);
this.tabPage7.Controls.Add(this.lbFreshrate);
this.tabPage7.Controls.Add(this.chkEnableStatistics);
this.tabPage7.Controls.Add(this.chkAllowLANConn);
this.tabPage7.Controls.Add(this.txturlGFWList);
this.tabPage7.Controls.Add(this.label13);
@@ -481,6 +518,24 @@
this.tabPage7.Name = "tabPage7";
this.tabPage7.UseVisualStyleBackColor = true;
//
// cbFreshrate
//
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbFreshrate.FormattingEnabled = true;
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.Name = "cbFreshrate";
//
// lbFreshrate
//
resources.ApplyResources(this.lbFreshrate, "lbFreshrate");
this.lbFreshrate.Name = "lbFreshrate";
//
// chkEnableStatistics
//
resources.ApplyResources(this.chkEnableStatistics, "chkEnableStatistics");
this.chkEnableStatistics.Name = "chkEnableStatistics";
this.chkEnableStatistics.UseVisualStyleBackColor = true;
//
// chkAllowLANConn
//
resources.ApplyResources(this.chkAllowLANConn, "chkAllowLANConn");
@@ -503,6 +558,31 @@
this.chkAutoRun.Name = "chkAutoRun";
this.chkAutoRun.UseVisualStyleBackColor = true;
//
// tabPage9
//
this.tabPage9.Controls.Add(this.txtuserPacRule);
this.tabPage9.Controls.Add(this.panel4);
resources.ApplyResources(this.tabPage9, "tabPage9");
this.tabPage9.Name = "tabPage9";
this.tabPage9.UseVisualStyleBackColor = true;
//
// txtuserPacRule
//
resources.ApplyResources(this.txtuserPacRule, "txtuserPacRule");
this.txtuserPacRule.Name = "txtuserPacRule";
//
// panel4
//
this.panel4.Controls.Add(this.label4);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Name = "panel4";
//
// label4
//
this.label4.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// panel2
//
this.panel2.Controls.Add(this.btnClose);
@@ -546,12 +626,16 @@
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);
this.tabPage6.PerformLayout();
this.tabPage7.ResumeLayout(false);
this.tabPage7.PerformLayout();
this.tabPage9.ResumeLayout(false);
this.tabPage9.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);
@@ -614,10 +698,19 @@
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.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.TabPage tabPage9;
private System.Windows.Forms.TextBox txtuserPacRule;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Label label4;
}
}
+111 -25
View File
@@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Text;
using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Base;
namespace v2rayN.Forms
{
@@ -23,6 +22,8 @@ namespace v2rayN.Forms
InitKCP();
InitGUI();
InitUserPAC();
}
/// <summary>
@@ -44,6 +45,10 @@ 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();
@@ -61,6 +66,8 @@ namespace v2rayN.Forms
//remoteDNS
txtremoteDNS.Text = config.remoteDNS;
cmblistenerType.SelectedIndex = config.listenerType;
}
/// <summary>
@@ -106,6 +113,40 @@ namespace v2rayN.Forms
chkAllowLANConn.Checked = config.allowLANConn;
var enableStatistics = config.enableStatistics;
chkEnableStatistics.Checked = enableStatistics;
var cbSource = new ComboItem[]
{
new ComboItem{ID = (int)Global.StatisticsFreshRate.quick, Text = UIRes.I18N("QuickFresh")},
new ComboItem{ID = (int)Global.StatisticsFreshRate.medium, Text = UIRes.I18N("MediumFresh")},
new ComboItem{ID = (int)Global.StatisticsFreshRate.slow, Text = UIRes.I18N("SlowFresh")},
};
cbFreshrate.DataSource = cbSource;
cbFreshrate.DisplayMember = "Text";
cbFreshrate.ValueMember = "ID";
switch (config.statisticsFreshRate)
{
case (int)Global.StatisticsFreshRate.quick:
cbFreshrate.SelectedItem = cbSource[0];
break;
case (int)Global.StatisticsFreshRate.medium:
cbFreshrate.SelectedItem = cbSource[1];
break;
case (int)Global.StatisticsFreshRate.slow:
cbFreshrate.SelectedItem = cbSource[2];
break;
}
}
private void InitUserPAC()
{
txtuserPacRule.Text = Utils.List2String(config.userPacRule, true);
}
private void btnOK_Click(object sender, EventArgs e)
@@ -130,6 +171,11 @@ namespace v2rayN.Forms
return;
}
if (SaveUserPAC() != 0)
{
return;
}
if (ConfigHandler.SaveConfig(ref config) == 0)
{
this.DialogResult = DialogResult.OK;
@@ -148,14 +194,14 @@ namespace v2rayN.Forms
{
//日志
bool logEnabled = chklogEnabled.Checked;
string loglevel = cmbloglevel.Text.Trim();
string loglevel = cmbloglevel.Text.TrimEx();
//Mux
bool muxEnabled = chkmuxEnabled.Checked;
//本地监听
string localPort = txtlocalPort.Text.Trim();
string protocol = cmbprotocol.Text.Trim();
string localPort = txtlocalPort.Text.TrimEx();
string protocol = cmbprotocol.Text.TrimEx();
bool udpEnabled = chkudpEnabled.Checked;
bool sniffingEnabled = chksniffingEnabled.Checked;
if (Utils.IsNullOrEmpty(localPort) || !Utils.IsNumberic(localPort))
@@ -174,8 +220,8 @@ namespace v2rayN.Forms
config.inbound[0].sniffingEnabled = sniffingEnabled;
//本地监听2
string localPort2 = txtlocalPort2.Text.Trim();
string protocol2 = cmbprotocol2.Text.Trim();
string localPort2 = txtlocalPort2.Text.TrimEx();
string protocol2 = cmbprotocol2.Text.TrimEx();
bool udpEnabled2 = chkudpEnabled2.Checked;
bool sniffingEnabled2 = chksniffingEnabled2.Checked;
if (chkAllowIn2.Checked)
@@ -215,8 +261,9 @@ namespace v2rayN.Forms
config.muxEnabled = muxEnabled;
//remoteDNS
config.remoteDNS = txtremoteDNS.Text.Trim();
config.remoteDNS = txtremoteDNS.Text.TrimEx();
config.listenerType = cmblistenerType.SelectedIndex;
return 0;
}
@@ -230,9 +277,9 @@ namespace v2rayN.Forms
string domainStrategy = cmbdomainStrategy.Text;
string routingMode = cmbroutingMode.SelectedIndex.ToString();
string useragent = txtUseragent.Text.Trim();
string userdirect = txtUserdirect.Text.Trim();
string userblock = txtUserblock.Text.Trim();
string useragent = txtUseragent.Text.TrimEx();
string userdirect = txtUserdirect.Text.TrimEx();
string userblock = txtUserblock.Text.TrimEx();
config.domainStrategy = domainStrategy;
config.routingMode = routingMode;
@@ -250,12 +297,12 @@ namespace v2rayN.Forms
/// <returns></returns>
private int SaveKCP()
{
string mtu = txtKcpmtu.Text.Trim();
string tti = txtKcptti.Text.Trim();
string uplinkCapacity = txtKcpuplinkCapacity.Text.Trim();
string downlinkCapacity = txtKcpdownlinkCapacity.Text.Trim();
string readBufferSize = txtKcpreadBufferSize.Text.Trim();
string writeBufferSize = txtKcpwriteBufferSize.Text.Trim();
string mtu = txtKcpmtu.Text.TrimEx();
string tti = txtKcptti.Text.TrimEx();
string uplinkCapacity = txtKcpuplinkCapacity.Text.TrimEx();
string downlinkCapacity = txtKcpdownlinkCapacity.Text.TrimEx();
string readBufferSize = txtKcpreadBufferSize.Text.TrimEx();
string writeBufferSize = txtKcpwriteBufferSize.Text.TrimEx();
bool congestion = chkKcpcongestion.Checked;
if (Utils.IsNullOrEmpty(mtu) || !Utils.IsNumberic(mtu)
@@ -289,13 +336,35 @@ namespace v2rayN.Forms
Utils.SetAutoRun(chkAutoRun.Checked);
//自定义GFWList
config.urlGFWList = txturlGFWList.Text.Trim();
config.urlGFWList = txturlGFWList.Text.TrimEx();
config.allowLANConn = chkAllowLANConn.Checked;
var lastEnableStatistics = config.enableStatistics;
config.enableStatistics = chkEnableStatistics.Checked;
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue;
//if(lastEnableStatistics != config.enableStatistics)
//{
// /// https://stackoverflow.com/questions/779405/how-do-i-restart-my-c-sharp-winform-application
// // Shut down the current app instance.
// Application.Exit();
// // Restart the app passing "/restart [processId]" as cmd line args
// Process.Start(Application.ExecutablePath, "/restart " + Process.GetCurrentProcess().Id);
//}
return 0;
}
private int SaveUserPAC()
{
string userPacRule = txtuserPacRule.Text.TrimEx();
userPacRule = userPacRule.Replace("\"", "");
config.userPacRule = Utils.String2List(userPacRule);
return 0;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
@@ -315,10 +384,15 @@ 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 + "proxy");
lstUrl.Add(Global.CustomRoutingListUrl + "direct");
lstUrl.Add(Global.CustomRoutingListUrl + "block");
lstUrl.Add(Global.CustomRoutingListUrl + Global.agentTag);
lstUrl.Add(Global.CustomRoutingListUrl + Global.directTag);
lstUrl.Add(Global.CustomRoutingListUrl + Global.blockTag);
var lstTxt = new List<TextBox>();
lstTxt.Add(txtUseragent);
@@ -328,8 +402,8 @@ namespace v2rayN.Forms
for (int k = 0; k < lstUrl.Count; k++)
{
var txt = lstTxt[k];
V2rayUpdateHandle v2rayUpdateHandle3 = new V2rayUpdateHandle();
v2rayUpdateHandle3.UpdateCompleted += (sender2, args) =>
DownloadHandle downloadHandle = new DownloadHandle();
downloadHandle.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
@@ -345,12 +419,12 @@ namespace v2rayN.Forms
AppendText(false, args.Msg);
}
};
v2rayUpdateHandle3.Error += (sender2, args) =>
downloadHandle.Error += (sender2, args) =>
{
AppendText(true, args.GetException().Message);
};
v2rayUpdateHandle3.WebDownloadString(lstUrl[k]);
downloadHandle.WebDownloadString(lstUrl[k]);
}
}
void AppendText(bool notify, string text)
@@ -358,4 +432,16 @@ namespace v2rayN.Forms
labRoutingTips.Text = text;
}
}
class ComboItem
{
public int ID
{
get; set;
}
public string Text
{
get; set;
}
}
}
File diff suppressed because it is too large Load Diff
@@ -121,6 +121,27 @@
<value>取消(&amp;C)</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>
@@ -193,52 +214,32 @@
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<data name="txtUseragent.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value> 代理的Domain或IP </value>
<value> 1.代理的Domain或IP </value>
</data>
<data name="txtUserdirect.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>
</data>
<data name="tabPage4.Text" xml:space="preserve">
<value> 直连的Domain或IP </value>
<value> 2.直连的Domain或IP </value>
</data>
<data name="txtUserblock.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>
</data>
<data name="tabPage5.Text" xml:space="preserve">
<value> 阻止的Domain或IP </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>381, 43</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>
<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>
<value> 3.阻止的Domain或IP </value>
</data>
<data name="cmbroutingMode.Items" xml:space="preserve">
<value>全局</value>
@@ -252,8 +253,64 @@
<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>232, 20</value>
<value>244, 20</value>
</data>
<data name="tabPage8.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
</data>
<data name="tabPage8.Text" xml:space="preserve">
<value> 4.预定义规则 </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>
<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>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>642, 72</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value> Core:路由设置 </value>
@@ -261,6 +318,18 @@
<data name="tabPage6.Text" xml:space="preserve">
<value> Core:KCP设置 </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="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>
@@ -282,6 +351,12 @@
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>*设置用户PAC规则,用逗号(,)隔开</value>
</data>
<data name="tabPage9.Text" xml:space="preserve">
<value> 用户PAC设置 </value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
+1 -1
View File
@@ -26,7 +26,7 @@ namespace v2rayN.Forms
if (Index >= 0)
{
string url = ConfigHandler.GetVmessQRCode(config, Index);
if (string.IsNullOrEmpty(url))
if (Utils.IsNullOrEmpty(url))
{
picQRCode.Image = null;
txtUrl.Text = string.Empty;
+3 -2
View File
@@ -1,5 +1,6 @@
using System;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Forms
@@ -35,8 +36,8 @@ namespace v2rayN.Forms
{
if (subItem != null)
{
subItem.remarks = txtRemarks.Text.Trim();
subItem.url = txtUrl.Text.Trim();
subItem.remarks = txtRemarks.Text.TrimEx();
subItem.url = txtUrl.Text.TrimEx();
subItem.enabled = chkEnabled.Checked;
}
}
+68 -17
View File
@@ -5,29 +5,28 @@ 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-sfo2.digitalocean.com/10mb.test";
public const string SpeedTestUrl = @"http://speedtest-sgp1.digitalocean.com/10mb.test";
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
/// <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 = @"https://1.2345345.xyz/ads.html";
public const string PromotionUrl = @"aHR0cHM6Ly8xLjIzNDQ1Ni54eXovYWJjLmh0bWw=";
/// <summary>
/// 本软件配置文件名
@@ -60,6 +59,8 @@ namespace v2rayN
/// </summary>
public const string BlankPacFileName = "v2rayN.Sample.BlankPac.txt";
public const string CustomRoutingFileName = "v2rayN.Sample.custom_routing_";
/// <summary>
/// 默认加密方式
@@ -96,6 +97,18 @@ namespace v2rayN
/// </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>
@@ -141,6 +154,16 @@ namespace v2rayN
/// </summary>
public const string CustomIconName = "v2rayN.ico";
public enum StatisticsFreshRate
{
quick = 1000,
medium = 2000,
slow = 3000
}
public const string StatisticLogOverall = "StatisticLogOverall.json";
public const string IEProxyExceptions = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*";
#endregion
#region
@@ -148,27 +171,55 @@ 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 sysAgentPort { get; set; }
public static int httpPort
{
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 Job processJob
{
get; set;
}
#endregion
+40 -21
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Net;
using v2rayN.Mode;
using v2rayN.Base;
namespace v2rayN.Handler
{
@@ -40,6 +41,12 @@ namespace v2rayN.Handler
////默认监听端口
//config.pacPort = 8888;
// 默认不开启统计
config.enableStatistics = false;
// 默认中等刷新率
config.statisticsFreshRate = (int)Global.StatisticsFreshRate.medium;
}
//本地监听
@@ -47,7 +54,7 @@ namespace v2rayN.Handler
{
config.inbound = new List<InItem>();
InItem inItem = new InItem();
inItem.protocol = "socks";
inItem.protocol = Global.InboundSocks;
inItem.localPort = 10808;
inItem.udpEnabled = true;
inItem.sniffingEnabled = true;
@@ -66,7 +73,7 @@ namespace v2rayN.Handler
//http协议不由core提供,只保留socks
if (config.inbound.Count > 0)
{
config.inbound[0].protocol = "socks";
config.inbound[0].protocol = Global.InboundSocks;
}
}
//路由规则
@@ -111,11 +118,23 @@ 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)
{
config.subItem = new List<SubItem>();
}
if (config.userPacRule == null)
{
config.userPacRule = new List<string>();
}
if (config == null
|| config.index < 0
@@ -152,14 +171,14 @@ namespace v2rayN.Handler
vmessItem.configVersion = 2;
vmessItem.configType = (int)EConfigType.Vmess;
vmessItem.address = vmessItem.address.Trim();
vmessItem.id = vmessItem.id.Trim();
vmessItem.security = vmessItem.security.Trim();
vmessItem.network = vmessItem.network.Trim();
vmessItem.headerType = vmessItem.headerType.Trim();
vmessItem.requestHost = vmessItem.requestHost.Trim();
vmessItem.path = vmessItem.path.Trim();
vmessItem.streamSecurity = vmessItem.streamSecurity.Trim();
vmessItem.address = vmessItem.address.TrimEx();
vmessItem.id = vmessItem.id.TrimEx();
vmessItem.security = vmessItem.security.TrimEx();
vmessItem.network = vmessItem.network.TrimEx();
vmessItem.headerType = vmessItem.headerType.TrimEx();
vmessItem.requestHost = vmessItem.requestHost.TrimEx();
vmessItem.path = vmessItem.path.TrimEx();
vmessItem.streamSecurity = vmessItem.streamSecurity.TrimEx();
if (index >= 0)
{
@@ -293,9 +312,9 @@ namespace v2rayN.Handler
/// </summary>
/// <param name="config"></param>
/// <returns></returns>
public static int SaveConfig(ref Config config)
public static int SaveConfig(ref Config config, bool reload = true)
{
Global.reloadV2ray = true;
Global.reloadV2ray = reload;
ToJsonFile(config);
@@ -306,7 +325,7 @@ namespace v2rayN.Handler
/// 存储文件
/// </summary>
/// <param name="config"></param>
public static void ToJsonFile(Config config)
private static void ToJsonFile(Config config)
{
Utils.ToJsonFile(config, Utils.GetPath(configRes));
}
@@ -328,7 +347,7 @@ namespace v2rayN.Handler
{
VmessQRCode vmessQRCode = new VmessQRCode();
vmessQRCode.v = vmessItem.configVersion.ToString();
vmessQRCode.ps = vmessItem.remarks.Trim(); //备注也许很长 ;
vmessQRCode.ps = vmessItem.remarks.TrimEx(); //备注也许很长 ;
vmessQRCode.add = vmessItem.address;
vmessQRCode.port = vmessItem.port.ToString();
vmessQRCode.id = vmessItem.id;
@@ -505,11 +524,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, newFileName);
File.Copy(fileName, Path.Combine(Utils.GetTempPath(), newFileName));
}
catch
{
@@ -566,10 +585,10 @@ namespace v2rayN.Handler
vmessItem.configVersion = 2;
vmessItem.configType = (int)EConfigType.Shadowsocks;
vmessItem.address = vmessItem.address.Trim();
vmessItem.id = vmessItem.id.Trim();
vmessItem.security = vmessItem.security.Trim();
vmessItem.address = vmessItem.address.TrimEx();
vmessItem.id = vmessItem.id.TrimEx();
vmessItem.security = vmessItem.security.TrimEx();
if (index >= 0)
{
//修改
@@ -607,7 +626,7 @@ namespace v2rayN.Handler
vmessItem.configVersion = 2;
vmessItem.configType = (int)EConfigType.Socks;
vmessItem.address = vmessItem.address.Trim();
vmessItem.address = vmessItem.address.TrimEx();
if (index >= 0)
{
+339
View File
@@ -0,0 +1,339 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text;
using v2rayN.Base;
using v2rayN.Mode;
using v2rayN.Properties;
namespace v2rayN.Handler
{
/// <summary>
///Download
/// </summary>
class DownloadHandle
{
public event EventHandler<ResultEventArgs> AbsoluteCompleted;
public event EventHandler<ResultEventArgs> UpdateCompleted;
public event ErrorEventHandler Error;
public string DownloadFileName
{
get
{
return "v2ray-windows.zip";
}
}
public class ResultEventArgs : EventArgs
{
public bool Success;
public string Msg;
public ResultEventArgs(bool success, string msg)
{
this.Success = success;
this.Msg = msg;
}
}
private int progressPercentage = -1;
private long totalBytesToReceive = 0;
private DateTime totalDatetime = new DateTime();
private int DownloadTimeout = -1;
#region v2rayN
private string nLatestUrl = "https://github.com/2dust/v2rayN/releases/latest";
private const string nUrl = "https://github.com/2dust/v2rayN/releases/download/{0}/v2rayN.zip";
public void AbsoluteV2rayN(Config config)
{
Utils.SetSecurityProtocol();
WebRequest request = WebRequest.Create(nLatestUrl);
request.BeginGetResponse(new AsyncCallback(OnResponseV2rayN), request);
}
private void OnResponseV2rayN(IAsyncResult ar)
{
try
{
HttpWebRequest request = (HttpWebRequest)ar.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(ar);
string redirectUrl = response.ResponseUri.AbsoluteUri;
string version = redirectUrl.Substring(redirectUrl.LastIndexOf("/", StringComparison.Ordinal) + 1);
var curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
if (curVersion == version)
{
if (AbsoluteCompleted != null)
{
AbsoluteCompleted(this, new ResultEventArgs(false, "Already the latest version"));
}
return;
}
string url = string.Format(nUrl, version);
if (AbsoluteCompleted != null)
{
AbsoluteCompleted(this, new ResultEventArgs(true, url));
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
if (Error != null)
Error(this, new ErrorEventArgs(ex));
}
}
#endregion
#region Core
private string coreLatestUrl = "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";
public void AbsoluteV2rayCore(Config config)
{
Utils.SetSecurityProtocol();
WebRequest request = WebRequest.Create(coreLatestUrl);
request.BeginGetResponse(new AsyncCallback(OnResponseV2rayCore), request);
}
private void OnResponseV2rayCore(IAsyncResult ar)
{
try
{
HttpWebRequest request = (HttpWebRequest)ar.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(ar);
string redirectUrl = response.ResponseUri.AbsoluteUri;
string version = redirectUrl.Substring(redirectUrl.LastIndexOf("/", StringComparison.Ordinal) + 1);
string osBit = string.Empty;
if (Environment.Is64BitProcess)
{
osBit = "64";
}
else
{
osBit = "32";
}
string url = string.Format(coreUrl, version, osBit);
if (AbsoluteCompleted != null)
{
AbsoluteCompleted(this, new ResultEventArgs(true, url));
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
if (Error != null)
Error(this, new ErrorEventArgs(ex));
}
}
#endregion
#region Download
public void DownloadFileAsync(Config config, string url, WebProxy webProxy, int downloadTimeout)
{
try
{
Utils.SetSecurityProtocol();
if (UpdateCompleted != null)
{
UpdateCompleted(this, new ResultEventArgs(false, "Downloading..."));
}
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));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
if (Error != null)
Error(this, new ErrorEventArgs(ex));
}
}
void ws_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
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);
UpdateCompleted(this, new ResultEventArgs(false, msg));
}
}
}
void ws_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
try
{
if (UpdateCompleted != null)
{
if (e.Cancelled)
{
((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;
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
if (Error != null)
Error(this, new ErrorEventArgs(ex));
}
}
/// <summary>
/// DownloadString
/// </summary>
/// <param name="url"></param>
public void WebDownloadString(string url)
{
string source = string.Empty;
try
{
Utils.SetSecurityProtocol();
WebClientEx ws = new WebClientEx();
ws.DownloadStringCompleted += Ws_DownloadStringCompleted;
ws.DownloadStringAsync(new Uri(url));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private void Ws_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
try
{
if (e.Error == null
|| Utils.IsNullOrEmpty(e.Error.ToString()))
{
string source = e.Result;
if (UpdateCompleted != null)
{
UpdateCompleted(this, new ResultEventArgs(true, source));
}
}
else
{
throw e.Error;
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
if (Error != null)
Error(this, new ErrorEventArgs(ex));
}
}
#endregion
#region PAC
public string GenPacFile(string result)
{
try
{
File.WriteAllText(Utils.GetTempPath("gfwlist.txt"), result, Encoding.UTF8);
List<string> lines = ParsePacResult(result);
string abpContent = Utils.UnGzip(Resources.abp_js);
abpContent = abpContent.Replace("__RULES__", JsonConvert.SerializeObject(lines, Formatting.Indented));
File.WriteAllText(Utils.GetPath(Global.pacFILE), abpContent, Encoding.UTF8);
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return ex.Message;
}
return string.Empty;
}
private List<string> ParsePacResult(string response)
{
IEnumerable<char> IgnoredLineBegins = new[] { '!', '[' };
byte[] bytes = Convert.FromBase64String(response);
string content = Encoding.UTF8.GetString(bytes);
List<string> valid_lines = new List<string>();
using (var sr = new StringReader(content))
{
foreach (var line in sr.NonWhiteSpaceLines())
{
if (line.BeginWithAny(IgnoredLineBegins))
continue;
valid_lines.Add(line);
}
}
return valid_lines;
}
#endregion
}
}
+155
View File
@@ -0,0 +1,155 @@
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));
}
}
}
}
-190
View File
@@ -1,190 +0,0 @@
using System;
using Microsoft.Win32;
using System.Runtime.InteropServices;
namespace v2rayN.Handler
{
/// <summary>
/// 设置系统代理类
/// </summary>
class ProxySetting
{
public static bool UnsetProxy()
{
return SetProxy(null, null);
}
public static bool SetProxy(string strProxy)
{
return SetProxy(strProxy, null);
}
public static bool SetProxy(string strProxy, string exceptions)
{
InternetPerConnOptionList list = new InternetPerConnOptionList();
int optionCount = string.IsNullOrEmpty(strProxy) ? 1 : (string.IsNullOrEmpty(exceptions) ? 2 : 3);
InternetConnectionOption[] options = new InternetConnectionOption[optionCount];
// USE a proxy server ...
options[0].m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS;
options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY));
// use THIS proxy server
if (optionCount > 1)
{
options[1].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER;
options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy);
// except for these addresses ...
if (optionCount > 2)
{
options[2].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_BYPASS;
options[2].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(exceptions);
}
}
// default stuff
list.dwSize = Marshal.SizeOf(list);
list.szConnection = IntPtr.Zero;
list.dwOptionCount = options.Length;
list.dwOptionError = 0;
int optSize = Marshal.SizeOf(typeof(InternetConnectionOption));
// make a pointer out of all that ...
IntPtr optionsPtr = Marshal.AllocCoTaskMem(optSize * options.Length);
// copy the array over into that spot in memory ...
for (int i = 0; i < options.Length; ++i)
{
IntPtr opt = new IntPtr(optionsPtr.ToInt32() + (i * optSize));
Marshal.StructureToPtr(options[i], opt, false);
}
list.options = optionsPtr;
// and then make a pointer out of the whole list
IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((Int32)list.dwSize);
Marshal.StructureToPtr(list, ipcoListPtr, false);
// and finally, call the API method!
int returnvalue = NativeMethods.InternetSetOption(IntPtr.Zero,
InternetOption.INTERNET_OPTION_PER_CONNECTION_OPTION,
ipcoListPtr, list.dwSize) ? -1 : 0;
if (returnvalue == 0)
{ // get the error codes, they might be helpful
returnvalue = Marshal.GetLastWin32Error();
}
// FREE the data ASAP
Marshal.FreeCoTaskMem(optionsPtr);
Marshal.FreeCoTaskMem(ipcoListPtr);
if (returnvalue > 0)
{ // throw the error codes, they might be helpful
//throw new Win32Exception(Marshal.GetLastWin32Error());
}
return (returnvalue < 0);
}
#region WinInet structures
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct InternetPerConnOptionList
{
public int dwSize; // size of the INTERNET_PER_CONN_OPTION_LIST struct
public IntPtr szConnection; // connection name to set/query options
public int dwOptionCount; // number of options to set/query
public int dwOptionError; // on error, which option failed
//[MarshalAs(UnmanagedType.)]
public IntPtr options;
};
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct InternetConnectionOption
{
static readonly int Size;
public PerConnOption m_Option;
public InternetConnectionOptionValue m_Value;
static InternetConnectionOption()
{
InternetConnectionOption.Size = Marshal.SizeOf(typeof(InternetConnectionOption));
}
// Nested Types
[StructLayout(LayoutKind.Explicit)]
public struct InternetConnectionOptionValue
{
// Fields
[FieldOffset(0)]
public System.Runtime.InteropServices.ComTypes.FILETIME m_FileTime;
[FieldOffset(0)]
public int m_Int;
[FieldOffset(0)]
public IntPtr m_StringPtr;
}
}
#endregion
#region WinInet enums
//
// options manifests for Internet{Query|Set}Option
//
public enum InternetOption : uint
{
INTERNET_OPTION_PER_CONNECTION_OPTION = 75
}
//
// Options used in INTERNET_PER_CONN_OPTON struct
//
public enum PerConnOption
{
INTERNET_PER_CONN_FLAGS = 1, // Sets or retrieves the connection type. The Value member will contain one or more of the values from PerConnFlags
INTERNET_PER_CONN_PROXY_SERVER = 2, // Sets or retrieves a string containing the proxy servers.
INTERNET_PER_CONN_PROXY_BYPASS = 3, // Sets or retrieves a string containing the URLs that do not use the proxy server.
INTERNET_PER_CONN_AUTOCONFIG_URL = 4//, // Sets or retrieves a string containing the URL to the automatic configuration script.
}
//
// PER_CONN_FLAGS
//
[Flags]
public enum PerConnFlags
{
PROXY_TYPE_DIRECT = 0x00000001, // direct to net
PROXY_TYPE_PROXY = 0x00000002, // via named proxy
PROXY_TYPE_AUTO_PROXY_URL = 0x00000004, // autoproxy URL
PROXY_TYPE_AUTO_DETECT = 0x00000008 // use autoproxy detection
}
#endregion
internal static class NativeMethods
{
[DllImport("WinInet.dll", SetLastError = true, CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool InternetSetOption(IntPtr hInternet, InternetOption dwOption, IntPtr lpBuffer, int dwBufferLength);
}
//判断是否使用代理
public static bool UsedProxy()
{
RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
if (rk.GetValue("ProxyEnable").ToString() == "1")
{
rk.Close();
return true;
}
else
{
rk.Close();
return false;
}
}
//获得代理的IP和端口
public static string GetProxyProxyServer()
{
RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
string ProxyServer = rk.GetValue("ProxyServer").ToString();
rk.Close();
return ProxyServer;
}
}
}
@@ -1,53 +0,0 @@
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace v2rayN.Handler
{
/// <summary>
/// 路由规则文件处理类
/// </summary>
class RoutingRuleHandler
{
/// <summary>
/// Parse Pac to v2ray rule
/// </summary>
/// <param name="filePath"></param>
/// <returns></returns>
public static List<string> ParsePac(string filePath)
{
string result = Utils.LoadResource(filePath);
if (Utils.IsNullOrEmpty(result))
{
return null;
}
//取得rule
string pattern = @"(?is)(?<=\[)(.*)(?=\])";
Regex rgx = new Regex(pattern);
result = rgx.Match(result).Value;
int index = result.IndexOf("];");
result = result.Substring(0, index);
if (Utils.IsNullOrEmpty(result))
{
return null;
}
string[] arrPac = result.Split(',');
List<string> lstPac = new List<string>();
foreach (string str in arrPac)
{
//处理有效值
if (Utils.IsNullOrEmpty(str)
|| str.Length <= 3)
{
continue;
}
string value = str.Replace("\",", "").Replace("\"", "").Replace(",", "").Replace("\r\n", "").Replace(" ", "");
lstPac.Add(value);
}
return lstPac;
}
}
}
+312
View File
@@ -0,0 +1,312 @@
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, 20);
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;
}
}
}
+285
View File
@@ -0,0 +1,285 @@
using Grpc.Core;
using System;
using System.Collections.Generic;
using System.IO;
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_;
public bool Enable
{
get; set;
}
public bool UpdateUI
{
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;
UpdateUI = false;
updateFunc_ = update;
exitFlag_ = false;
LoadFromFile();
GrpcInit();
workThread_ = new Thread(new ThreadStart(Run));
workThread_.IsBackground = true;
workThread_.Start();
}
private void GrpcInit()
{
if (channel_ == null)
{
Global.statePort = GetFreePort();
channel_ = new Channel($"{Global.Loopback}:{Global.statePort}", ChannelCredentials.Insecure);
channel_.ConnectAsync();
client_ = new StatsService.StatsServiceClient(channel_);
}
}
public void Close()
{
try
{
exitFlag_ = true;
channel_.ShutdownAsync();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
public void Run()
{
while (!exitFlag_)
{
try
{
if (Enable && channel_.State == ChannelState.Ready)
{
QueryStatsResponse res = null;
try
{
res = client_.QueryStats(new QueryStatsRequest() { Pattern = "", Reset = true });
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
if (res != null)
{
var itemId = config_.getItemId();
var serverStatItem = GetServerStatItem(itemId);
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;
if (UpdateUI)
{
updateFunc_(up, down, new List<ServerStatItem> { serverStatItem });
}
}
}
Thread.Sleep(config_.statisticsFreshRate);
channel_.ConnectAsync();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
}
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)
{
up = 0; down = 0;
try
{
foreach (var stat in source)
{
var name = stat.Name;
var value = stat.Value;
var nStr = name.Split(">>>".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
var type = "";
name = name.Trim();
name = nStr[1];
type = nStr[3];
if (name == Global.agentTag)
{
if (type == "uplink")
{
up = (ulong)value;
}
else if (type == "downlink")
{
down = (ulong)value;
}
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private int GetFreePort()
{
int defaultPort = 28123;
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;
}
catch (Exception ex)
{
// in case access denied
Utils.SaveLog(ex.Message, ex);
return defaultPort;
}
}
}
}
+191 -17
View File
@@ -1,9 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using v2rayN.Mode;
using System.Linq;
using System.Net;
using System.Text;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
{
@@ -78,6 +79,9 @@ namespace v2rayN.Handler
//dns
dns(config, ref v2rayConfig);
// TODO: 统计配置
statistic(config, ref v2rayConfig);
Utils.ToJsonFile(v2rayConfig, fileName);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
@@ -155,7 +159,7 @@ namespace v2rayN.Handler
}
else
{
inbound.listen = "127.0.0.1";
inbound.listen = Global.Loopback;
}
//开启udp
inbound.settings.udp = config.inbound[0].udpEnabled;
@@ -235,7 +239,7 @@ namespace v2rayN.Handler
for (int k = 0; k < userRule.Count; k++)
{
string url = userRule[k].Trim();
string url = userRule[k].TrimEx();
if (Utils.IsNullOrEmpty(url))
{
continue;
@@ -399,9 +403,11 @@ namespace v2rayN.Handler
//远程服务器地址和端口
serversItem.address = config.address();
serversItem.port = config.port();
serversItem.method = null;
serversItem.password = null;
if (!string.IsNullOrEmpty(config.security())
&& !string.IsNullOrEmpty(config.id()))
if (!Utils.IsNullOrEmpty(config.security())
&& !Utils.IsNullOrEmpty(config.id()))
{
var socksUsersItem = new SocksUsersItem();
socksUsersItem.user = config.security();
@@ -439,7 +445,7 @@ namespace v2rayN.Handler
var host = config.requestHost();
//if tls
if (config.streamSecurity() == "tls")
if (config.streamSecurity() == Global.StreamSecurity)
{
streamSettings.security = config.streamSecurity();
@@ -613,6 +619,53 @@ namespace v2rayN.Handler
return 0;
}
public static int statistic(Config config, ref V2rayConfig v2rayConfig)
{
if (config.enableStatistics)
{
var tag = Global.InboundAPITagName;
var apiObj = new Mode.API();
var policyObj = new Mode.Policy();
var policySystemSetting = new Mode.SystemPolicy();
string[] services = { "StatsService" };
v2rayConfig.stats = new Stats();
apiObj.tag = tag;
apiObj.services = services.ToList();
v2rayConfig.api = apiObj;
policySystemSetting.statsInboundDownlink = true;
policySystemSetting.statsInboundUplink = true;
policyObj.system = policySystemSetting;
v2rayConfig.policy = policyObj;
if (!v2rayConfig.inbounds.Exists(item => { return item.tag == tag; }))
{
var apiInbound = new Mode.Inbounds();
var apiInboundSettings = new Mode.Inboundsettings();
apiInbound.tag = tag;
apiInbound.listen = Global.Loopback;
apiInbound.port = Global.statePort;
apiInbound.protocol = Global.InboundAPIProtocal;
apiInboundSettings.address = Global.Loopback;
apiInbound.settings = apiInboundSettings;
v2rayConfig.inbounds.Add(apiInbound);
}
if (!v2rayConfig.routing.rules.Exists(item => { return item.outboundTag == tag; }))
{
var apiRoutingRule = new Mode.RulesItem();
apiRoutingRule.inboundTag = new List<string> { tag };
apiRoutingRule.outboundTag = tag;
apiRoutingRule.type = "field";
v2rayConfig.routing.rules.Add(apiRoutingRule);
}
}
return 0;
}
/// <summary>
/// 生成v2ray的客户端配置文件(自定义配置)
/// </summary>
@@ -637,11 +690,21 @@ 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());
@@ -913,6 +976,13 @@ namespace v2rayN.Handler
}
}
//tls
if (outbound.streamSettings != null
&& outbound.streamSettings.security != null
&& outbound.streamSettings.security == Global.StreamSecurity)
{
vmessItem.streamSecurity = Global.StreamSecurity;
}
}
catch
{
@@ -1050,6 +1120,14 @@ namespace v2rayN.Handler
vmessItem.requestHost = Utils.List2String(inbound.streamSettings.httpSettings.host);
}
}
//tls
if (inbound.streamSettings != null
&& inbound.streamSettings.security != null
&& inbound.streamSettings.security == Global.StreamSecurity)
{
vmessItem.streamSecurity = Global.StreamSecurity;
}
}
catch
{
@@ -1073,7 +1151,7 @@ namespace v2rayN.Handler
try
{
//载入配置文件
string result = clipboardData.Trim();// Utils.GetClipboardData();
string result = clipboardData.TrimEx();// Utils.GetClipboardData();
if (Utils.IsNullOrEmpty(result))
{
msg = UIRes.I18N("FailedReadConfiguration");
@@ -1104,17 +1182,26 @@ namespace v2rayN.Handler
vmessItem.network = Global.DefaultNetwork;
vmessItem.headerType = Global.None;
vmessItem.configVersion = Utils.ToInt(vmessQRCode.v);
vmessItem.remarks = vmessQRCode.ps;
vmessItem.address = vmessQRCode.add;
vmessItem.remarks = Utils.ToString(vmessQRCode.ps);
vmessItem.address = Utils.ToString(vmessQRCode.add);
vmessItem.port = Utils.ToInt(vmessQRCode.port);
vmessItem.id = vmessQRCode.id;
vmessItem.id = Utils.ToString(vmessQRCode.id);
vmessItem.alterId = Utils.ToInt(vmessQRCode.aid);
vmessItem.network = vmessQRCode.net;
vmessItem.headerType = vmessQRCode.type;
vmessItem.requestHost = vmessQRCode.host;
vmessItem.path = vmessQRCode.path;
vmessItem.streamSecurity = vmessQRCode.tls;
if (!Utils.IsNullOrEmpty(vmessQRCode.net))
{
vmessItem.network = vmessQRCode.net;
}
if (!Utils.IsNullOrEmpty(vmessQRCode.type))
{
vmessItem.headerType = vmessQRCode.type;
}
vmessItem.requestHost = Utils.ToString(vmessQRCode.host);
vmessItem.path = Utils.ToString(vmessQRCode.path);
vmessItem.streamSecurity = Utils.ToString(vmessQRCode.tls);
}
ConfigHandler.UpgradeServerVersion(ref vmessItem);
@@ -1290,5 +1377,92 @@ 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");
Config configCopy = Utils.DeepCopy<Config>(config);
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(configCopy, ref v2rayConfig, false);
//routing(config, ref v2rayConfig);
dns(configCopy, ref v2rayConfig);
var httpPort = configCopy.GetLocalPort("speedtest");
for (int k = 0; k < selecteds.Count; k++)
{
int index = selecteds[k];
if (configCopy.vmess[index].configType == (int)EConfigType.Custom)
{
continue;
}
configCopy.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(configCopy, 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"), configCopy.getSummary());
}
catch (Exception ex)
{
msg = UIRes.I18N("FailedGenDefaultConfiguration");
return -1;
}
return 0;
}
#endregion
}
}
+83 -15
View File
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using v2rayN.Mode;
namespace v2rayN.Handler
@@ -22,7 +23,8 @@ namespace v2rayN.Handler
private static string v2rayConfigRes = Global.v2rayConfigFileName;
private List<string> lstV2ray;
public event ProcessDelegate ProcessEvent;
private int processId = 0;
//private int processId = 0;
private Process _process;
public V2rayHandler()
{
@@ -52,6 +54,27 @@ 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>
@@ -68,27 +91,49 @@ namespace v2rayN.Handler
{
try
{
bool blExist = true;
if (processId > 0)
if (_process != null)
{
Process p1 = Process.GetProcessById(processId);
if (p1 != null)
{
p1.Kill();
blExist = false;
}
KillProcess(_process);
_process.Dispose();
_process = null;
}
if (blExist)
else
{
foreach (string vName in lstV2ray)
{
Process[] killPro = Process.GetProcessesByName(vName);
foreach (Process p in killPro)
Process[] existing = Process.GetProcessesByName(vName);
foreach (Process p in existing)
{
p.Kill();
var path = p.MainModule.FileName;
if (path == $"{Utils.GetPath(vName)}.exe")
{
KillProcess(p);
}
}
}
}
//bool blExist = true;
//if (processId > 0)
//{
// Process p1 = Process.GetProcessById(processId);
// if (p1 != null)
// {
// p1.Kill();
// blExist = false;
// }
//}
//if (blExist)
//{
// foreach (string vName in lstV2ray)
// {
// Process[] killPro = Process.GetProcessesByName(vName);
// foreach (Process p in killPro)
// {
// p.Kill();
// }
// }
//}
}
catch (Exception ex)
{
@@ -118,7 +163,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;
@@ -126,9 +171,11 @@ namespace v2rayN.Handler
Process p = new Process();
p.StartInfo.FileName = fileName;
p.StartInfo.WorkingDirectory = Utils.StartupPath();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.StandardOutputEncoding = Encoding.UTF8;
p.OutputDataReceived += new DataReceivedEventHandler((sender, e) =>
{
if (!String.IsNullOrEmpty(e.Data))
@@ -139,7 +186,10 @@ namespace v2rayN.Handler
});
p.Start();
p.BeginOutputReadLine();
processId = p.Id;
//processId = p.Id;
_process = p;
Global.processJob.AddProcess(p.Handle);
}
catch (Exception ex)
{
@@ -161,5 +211,23 @@ namespace v2rayN.Handler
ProcessEvent(notify, msg);
}
}
private void KillProcess(Process p)
{
try
{
p.CloseMainWindow();
p.WaitForExit(100);
if (!p.HasExited)
{
p.Kill();
p.WaitForExit();
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
}
}
-214
View File
@@ -1,214 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using Newtonsoft.Json;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.HttpProxyHandler;
namespace v2rayN.Handler
{
/// <summary>
///Update V2ray Core
/// </summary>
class V2rayUpdateHandle
{
public event EventHandler<ResultEventArgs> AbsoluteCompleted;
public event EventHandler<ResultEventArgs> UpdateCompleted;
public event ErrorEventHandler Error;
public string DownloadFileName
{
get { return "v2ray-windows.zip"; }
}
public class ResultEventArgs : EventArgs
{
public bool Success;
public string Msg;
public ResultEventArgs(bool success, string msg)
{
this.Success = success;
this.Msg = msg;
}
}
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();
public void AbsoluteV2rayCore(Config config)
{
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2
ServicePointManager.DefaultConnectionLimit = 256;
WebRequest request = WebRequest.Create(latestUrl);
request.BeginGetResponse(new AsyncCallback(OnResponse), request);
}
private void OnResponse(IAsyncResult ar)
{
try
{
HttpWebRequest request = (HttpWebRequest)ar.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(ar);
string redirectUrl = response.ResponseUri.AbsoluteUri;
string version = redirectUrl.Substring(redirectUrl.LastIndexOf("/", StringComparison.Ordinal) + 1);
string osBit = string.Empty;
if (Environment.Is64BitProcess)
{
osBit = "64";
}
else
{
osBit = "32";
}
string url = string.Format(coreURL, version, osBit);
if (AbsoluteCompleted != null)
{
AbsoluteCompleted(this, new ResultEventArgs(true, url));
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
if (Error != null)
Error(this, new ErrorEventArgs(ex));
}
}
public void DownloadFileAsync(Config config, string url)
{
try
{
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2
ServicePointManager.DefaultConnectionLimit = 256;
if (UpdateCompleted != null)
{
UpdateCompleted(this, new ResultEventArgs(false, url));
}
progressPercentage = -1;
WebClientEx ws = new WebClientEx();
ws.DownloadFileCompleted += ws_DownloadFileCompleted;
ws.DownloadProgressChanged += ws_DownloadProgressChanged;
ws.DownloadFileAsync(new Uri(url), Utils.GetPath(DownloadFileName));
blFirst = true;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
if (Error != null)
Error(this, new ErrorEventArgs(ex));
}
}
void ws_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
if (blFirst)
{
totalBytesToReceive = e.TotalBytesToReceive - e.BytesReceived;
totalDatetime = DateTime.Now;
blFirst = false;
}
if (UpdateCompleted != null)
{
if (progressPercentage != e.ProgressPercentage && e.ProgressPercentage % 10 == 0)
{
progressPercentage = e.ProgressPercentage;
string msg = string.Format("......{0}%", e.ProgressPercentage);
UpdateCompleted(this, new ResultEventArgs(false, msg));
}
}
}
void ws_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
try
{
if (e.Error == null
|| Utils.IsNullOrEmpty(e.Error.ToString()))
{
if (UpdateCompleted != null)
{
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;
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
if (Error != null)
Error(this, new ErrorEventArgs(ex));
}
}
/// <summary>
/// DownloadString
/// </summary>
/// <param name="url"></param>
public void WebDownloadString(string url)
{
string source = string.Empty;
try
{
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2
ServicePointManager.DefaultConnectionLimit = 256;
WebClientEx ws = new WebClientEx();
ws.DownloadStringCompleted += Ws_DownloadStringCompleted;
ws.DownloadStringAsync(new Uri(url));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private void Ws_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
try
{
if (e.Error == null
|| Utils.IsNullOrEmpty(e.Error.ToString()))
{
string source = e.Result;
if (UpdateCompleted != null)
{
UpdateCompleted(this, new ResultEventArgs(true, source));
}
}
else
{
throw e.Error;
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
if (Error != null)
Error(this, new ErrorEventArgs(ex));
}
}
}
}
@@ -6,26 +6,11 @@ namespace v2rayN.HttpProxyHandler
/// <summary>
/// 系统代理(http)总处理
/// 启动privoxy提供http协议
/// 使用SysProxy设置IE系统代理或者PAC模式
/// 设置IE系统代理或者PAC模式
/// </summary>
class HttpProxyHandle
{
private static string GetTimestamp(DateTime value)
{
return value.ToString("yyyyMMddHHmmssfff");
}
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)
private static bool Update(Config config, bool forceDisable)
{
int type = config.listenerType;
@@ -38,45 +23,40 @@ namespace v2rayN.HttpProxyHandler
{
if (type != 0)
{
var port = Global.sysAgentPort;
var port = Global.httpPort;
if (port <= 0)
{
return false;
}
if (type == 1)
{
PACServerHandle.Stop();
PACFileWatcherHandle.StopWatch();
SysProxyHandle.SetIEProxy(true, true, "127.0.0.1:" + port, null);
//PACServerHandle.Stop();
ProxySetting.SetProxy($"{Global.Loopback}:{port}", Global.IEProxyExceptions, 2);
}
else if (type == 2)
{
string pacUrl = GetPacUrl();
SysProxyHandle.SetIEProxy(true, false, null, pacUrl);
PACServerHandle.Stop();
ProxySetting.SetProxy(pacUrl, "", 4);
//PACServerHandle.Stop();
PACServerHandle.Init(config);
PACFileWatcherHandle.StartWatch(config);
}
else if (type == 3)
{
PACServerHandle.Stop();
PACFileWatcherHandle.StopWatch();
SysProxyHandle.SetIEProxy(false, false, null, null);
//PACServerHandle.Stop();
ProxySetting.UnsetProxy();
}
else if (type == 4)
{
string pacUrl = GetPacUrl();
SysProxyHandle.SetIEProxy(false, false, null, null);
PACServerHandle.Stop();
ProxySetting.UnsetProxy();
//PACServerHandle.Stop();
PACServerHandle.Init(config);
PACFileWatcherHandle.StartWatch(config);
}
}
else
{
SysProxyHandle.SetIEProxy(false, false, null, null);
PACServerHandle.Stop();
PACFileWatcherHandle.StopWatch();
ProxySetting.UnsetProxy();
//PACServerHandle.Stop();
}
}
catch (Exception ex)
@@ -90,20 +70,20 @@ namespace v2rayN.HttpProxyHandler
/// 启用系统代理(http)
/// </summary>
/// <param name="config"></param>
public static void StartHttpAgent(Config config)
private static void StartHttpAgent(Config config)
{
try
{
int localPort = config.GetLocalPort("socks");
int localPort = config.GetLocalPort(Global.InboundSocks);
if (localPort > 0)
{
PrivoxyHandler.Instance.Start(localPort, config);
PrivoxyHandler.Instance.Restart(localPort, config);
if (PrivoxyHandler.Instance.RunningPort > 0)
{
Global.sysAgent = true;
Global.socksPort = localPort;
Global.sysAgentPort = PrivoxyHandler.Instance.RunningPort;
Global.pacPort = Global.sysAgentPort + 1;
Global.httpPort = PrivoxyHandler.Instance.RunningPort;
Global.pacPort = config.GetLocalPort("pac");
}
}
}
@@ -120,16 +100,13 @@ namespace v2rayN.HttpProxyHandler
{
try
{
////开启全局代理则关闭
//if (Global.sysAgent)
//{
Update(config, true);
PrivoxyHandler.Instance.Stop();
Global.sysAgent = false;
Global.socksPort = 0;
Global.sysAgentPort = 0;
Global.pacPort = 0;
//}
Global.httpPort = 0;
}
catch
{
@@ -141,7 +118,7 @@ namespace v2rayN.HttpProxyHandler
/// </summary>
/// <param name="config"></param>
/// <param name="forced"></param>
public static bool RestartHttpAgent(Config config, bool forced)
public static void RestartHttpAgent(Config config, bool forced)
{
bool isRestart = false;
//强制重启或者socks端口变化
@@ -151,7 +128,7 @@ namespace v2rayN.HttpProxyHandler
}
else
{
int localPort = config.GetLocalPort("socks");
int localPort = config.GetLocalPort(Global.InboundSocks);
if (localPort != Global.socksPort)
{
isRestart = true;
@@ -161,16 +138,13 @@ namespace v2rayN.HttpProxyHandler
{
CloseHttpAgent(config);
StartHttpAgent(config);
return true;
}
return false;
Update(config, false);
}
public static string GetPacUrl()
{
string pacUrl = string.Format("http://127.0.0.1:{0}/pac/?t={1}", Global.pacPort,
GetTimestamp(DateTime.Now));
string pacUrl = $"http://{Global.Loopback}:{Global.pacPort}/pac/?t={ DateTime.Now.ToString("HHmmss")}";
return pacUrl;
}
}
@@ -1,132 +0,0 @@
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);
}
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 (!string.IsNullOrEmpty(returndata)
&& returndata.IndexOf("/pac/") >= 0
&& netStream.CanWrite)
{
BinaryWriter writer = new BinaryWriter(netStream);
//writeSuccess(writer, pac);
Byte[] sendBytes = Encoding.UTF8.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};charset=utf-8", content_type));
sb.AppendLine();
//sb.Append("Connection: close");
//sb.AppendLine();
sb.Append(pac);
sb.AppendLine();
return sb.ToString();
}
}
}
@@ -1,45 +0,0 @@
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;
}
}
}
}
@@ -1,92 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using Newtonsoft.Json;
using v2rayN.Mode;
using v2rayN.Properties;
namespace v2rayN.HttpProxyHandler
{
/// <summary>
/// 提供PAC功能支持
/// </summary>
class PACListHandle
{
public event EventHandler<ResultEventArgs> UpdateCompleted;
public event ErrorEventHandler Error;
public class ResultEventArgs : EventArgs
{
public bool Success;
public ResultEventArgs(bool success)
{
this.Success = success;
}
}
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 = GFWLIST_URL;
if (!Utils.IsNullOrEmpty(config.urlGFWList))
{
url = config.urlGFWList;
}
//默认用户已开启系统代理
//var httpProxy = config.inbound.FirstOrDefault(x => x.protocol=="http");
//if (httpProxy == null)
//{
// throw new Exception("未发现HTTP代理,无法设置代理更新");
//}
WebClient http = new WebClient();
//http.Headers.Add("Connection", "Close");
//http.Proxy = new WebProxy(IPAddress.Loopback.ToString(), httpProxy.localPort);
http.DownloadStringCompleted += http_DownloadStringCompleted;
http.DownloadStringAsync(new Uri(url));
}
private void http_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
try
{
File.WriteAllText(Utils.GetTempPath("gfwlist.txt"), e.Result, Encoding.UTF8);
List<string> lines = ParseResult(e.Result);
string abpContent = Utils.UnGzip(Resources.abp_js);
abpContent = abpContent.Replace("__RULES__", JsonConvert.SerializeObject(lines, Formatting.Indented));
File.WriteAllText(Utils.GetPath(Global.pacFILE), abpContent, Encoding.UTF8);
if (UpdateCompleted != null) UpdateCompleted(this, new ResultEventArgs(true));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
if (Error != null) Error(this, new ErrorEventArgs(ex));
}
}
public static List<string> ParseResult(string response)
{
byte[] bytes = Convert.FromBase64String(response);
string content = Encoding.ASCII.GetString(bytes);
List<string> valid_lines = new List<string>();
using (var sr = new StringReader(content))
{
foreach (var line in sr.NonWhiteSpaceLines())
{
if (line.BeginWithAny(IgnoredLineBegins))
continue;
valid_lines.Add(line);
}
}
return valid_lines;
}
}
}
@@ -1,12 +1,11 @@
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,20 +17,41 @@ namespace v2rayN.HttpProxyHandler
private static int pacPort = 0;
private static HttpWebServer server;
private static HttpWebServerB serverB;
private static Config _config;
public static void Init(Config config)
public static bool IsRunning
{
if (Utils.IsAdministrator())
get
{
InitServer("127.0.0.1");
}
else
{
InitServerB("127.0.0.1");
return (pacPort > 0);
}
}
public static void InitServer(string address)
public static void Init(Config config)
{
_config = config;
Global.pacPort = config.GetLocalPort("pac");
if (InitServer("*"))
{
pacPort = Global.pacPort;
}
//else if (InitServer(Global.Loopback))
//{
// pacPort = Global.pacPort;
//}
else if (InitServerB(Global.Loopback))
{
pacPort = Global.pacPort;
}
else
{
Utils.SaveLog("Webserver init failed ");
pacPort = 0;
}
}
private static bool InitServer(string address)
{
try
{
@@ -45,13 +65,12 @@ namespace v2rayN.HttpProxyHandler
if (server == null)
{
string prefixes = string.Format("http://{0}:{1}/pac/", "+", Global.pacPort);
string prefixes = string.Format("http://{0}:{1}/pac/", address, Global.pacPort);
Utils.SaveLog("Webserver prefixes " + prefixes);
HttpWebServer ws = new HttpWebServer(SendResponse, prefixes);
ws.Run();
server = new HttpWebServer(SendResponse, prefixes);
server.Run();
pacPort = Global.pacPort;
}
}
Utils.SaveLog("Webserver at " + address);
@@ -59,11 +78,12 @@ namespace v2rayN.HttpProxyHandler
catch (Exception ex)
{
Utils.SaveLog("Webserver InitServer " + ex.Message);
return false;
}
return true;
}
public static void InitServerB(string address)
public static bool InitServerB(string address)
{
try
{
@@ -78,22 +98,22 @@ namespace v2rayN.HttpProxyHandler
if (serverB == null)
{
serverB = new HttpWebServerB(Global.pacPort, SendResponse);
pacPort = Global.pacPort;
}
}
Utils.SaveLog("Webserver at " + address);
Utils.SaveLog("WebserverB at " + address);
}
catch (Exception ex)
{
Utils.SaveLog("Webserver InitServer " + ex.Message);
Utils.SaveLog("WebserverB InitServer " + ex.Message);
return false;
}
return true;
}
public static string SendResponse(HttpListenerRequest request)
public static string SendResponse(string address)
{
try
{
string address = request.LocalEndPoint.Address.ToString();
var pac = GetPacList(address);
return pac;
}
@@ -103,42 +123,26 @@ namespace v2rayN.HttpProxyHandler
return ex.Message;
}
}
public static string SendResponse(TcpClient tcpClient)
{
try
{
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(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
{
if (server != null)
{
server.Stop();
server = null;
}
if (serverB != null)
{
serverB.Stop();
serverB = null;
}
}
catch (Exception ex)
{
Utils.SaveLog("Webserver Stop " + ex.Message);
}
//try
//{
@@ -161,7 +165,7 @@ namespace v2rayN.HttpProxyHandler
private static string GetPacList(string address)
{
var port = Global.sysAgentPort;
var port = Global.httpPort;
if (port <= 0)
{
return "No port";
@@ -179,11 +183,25 @@ namespace v2rayN.HttpProxyHandler
}
var pac = File.ReadAllText(strPacfile, Encoding.UTF8);
pac = pac.Replace("__PROXY__", proxy);
if (_config.userPacRule.Count > 0)
{
var keyWords = "var rules = [";
if (pac.IndexOf(keyWords) >= 0)
{
var userPac = string.Join($"\",{Environment.NewLine}\"", _config.userPacRule.ToArray());
userPac = string.Format("\"{0}\",", userPac);
pac = pac.Replace(keyWords, keyWords + userPac);
}
}
return pac;
}
catch
{ }
{
}
return "No pac content";
}
}
}
@@ -22,21 +22,17 @@ namespace v2rayN.HttpProxyHandler
private static int _uid;
private static string _uniqueConfigFile;
private static Job _privoxyJob;
private Process _process;
private int _runningPort;
private bool _isRunning;
private static string _privoxyName = "v2ray_privoxy";
static PrivoxyHandler()
{
try
{
_uid = Application.StartupPath.GetHashCode(); // Currently we use ss's StartupPath to identify different Privoxy instance.
_uid = Application.StartupPath.GetHashCode();
_uniqueConfigFile = string.Format("privoxy_{0}.conf", _uid);
_privoxyJob = new Job();
FileManager.UncompressFile(Utils.GetTempPath("v2ray_privoxy.exe"), Resources.privoxy_exe);
FileManager.UncompressFile(Utils.GetTempPath("mgwz.dll"), Resources.mgwz_dll);
FileManager.UncompressFile(Utils.GetTempPath($"{_privoxyName}.exe"), Resources.privoxy_exe);
}
catch (IOException ex)
{
@@ -44,11 +40,6 @@ namespace v2rayN.HttpProxyHandler
}
}
private PrivoxyHandler()
{
}
/// <summary>
/// 单例
/// </summary>
@@ -66,64 +57,64 @@ namespace v2rayN.HttpProxyHandler
public int RunningPort
{
get
{
return _runningPort;
}
get; set;
}
public bool IsRunning
public void Restart(int localPort, Config config)
{
get
{
return _isRunning;
}
Stop();
Start(localPort, config);
}
public void Start(int localPort, Config config)
{
if (_process == null)
try
{
Process[] existingPrivoxy = Process.GetProcessesByName("v2ray_privoxy");
foreach (Process p in existingPrivoxy.Where(IsChildProcess))
if (_process == null)
{
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 =
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)
{
FileName = "v2ray_privoxy.exe",
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));
_process = new Process
{
// Configure the process using the StartInfo properties.
StartInfo =
{
FileName = $"{_privoxyName}.exe",
Arguments = _uniqueConfigFile,
WorkingDirectory = Utils.GetTempPath(),
WindowStyle = ProcessWindowStyle.Hidden,
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);
_isRunning = true;
/*
* 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.
*/
Global.processJob.AddProcess(_process.Handle);
}
}
catch (Exception ex)
{
RunningPort = 0;
Utils.SaveLog(ex.Message, ex);
}
}
@@ -134,7 +125,15 @@ namespace v2rayN.HttpProxyHandler
KillProcess(_process);
_process.Dispose();
_process = null;
_isRunning = false;
RunningPort = 0;
}
else
{
Process[] existingPrivoxy = Process.GetProcessesByName(_privoxyName);
foreach (Process p in existingPrivoxy.Where(IsChildProcess))
{
KillProcess(p);
}
}
}
@@ -175,7 +174,7 @@ namespace v2rayN.HttpProxyHandler
*/
var path = process.MainModule.FileName;
return Utils.GetTempPath("v2ray_privoxy.exe").Equals(path);
return Utils.GetTempPath($"{_privoxyName}.exe").Equals(path);
}
catch (Exception ex)
@@ -191,25 +190,5 @@ 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;
}
}
}
}
+41 -13
View File
@@ -8,26 +8,46 @@ namespace v2rayN.HttpProxyHandler
{
public static bool UnsetProxy()
{
return SetProxy(null, null);
}
public static bool SetProxy(string strProxy)
{
return SetProxy(strProxy, null);
return SetProxy(null, null, 1);
}
public static bool SetProxy(string strProxy, string exceptions)
public static bool SetProxy(string strProxy, string exceptions, int type)
{
InternetPerConnOptionList list = new InternetPerConnOptionList();
int optionCount = string.IsNullOrEmpty(strProxy) ? 1 : (string.IsNullOrEmpty(exceptions) ? 2 : 3);
int optionCount = 1;
if (type == 1)
{
optionCount = 1;
}
else if (type == 2 || type == 4)
{
optionCount = Utils.IsNullOrEmpty(exceptions) ? 2 : 3;
}
int m_Int = (int)PerConnFlags.PROXY_TYPE_DIRECT;
PerConnOption m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS;
if (type == 2)
{
m_Int = (int)(PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY);
m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER;
}
else if (type == 4)
{
m_Int = (int)(PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_AUTO_PROXY_URL);
m_Option = PerConnOption.INTERNET_PER_CONN_AUTOCONFIG_URL;
}
//int optionCount = Utils.IsNullOrEmpty(strProxy) ? 1 : (Utils.IsNullOrEmpty(exceptions) ? 2 : 3);
InternetConnectionOption[] options = new InternetConnectionOption[optionCount];
// USE a proxy server ...
options[0].m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS;
options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY));
//options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY));
options[0].m_Value.m_Int = m_Int;
// use THIS proxy server
if (optionCount > 1)
{
options[1].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER;
options[1].m_Option = m_Option;
options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy);
// except for these addresses ...
if (optionCount > 2)
@@ -50,14 +70,22 @@ namespace v2rayN.HttpProxyHandler
// copy the array over into that spot in memory ...
for (int i = 0; i < options.Length; ++i)
{
IntPtr opt = new IntPtr(optionsPtr.ToInt32() + (i * optSize));
Marshal.StructureToPtr(options[i], opt, false);
if (Environment.Is64BitOperatingSystem)
{
IntPtr opt = new IntPtr(optionsPtr.ToInt64() + (i * optSize));
Marshal.StructureToPtr(options[i], opt, false);
}
else
{
IntPtr opt = new IntPtr(optionsPtr.ToInt32() + (i * optSize));
Marshal.StructureToPtr(options[i], opt, false);
}
}
list.options = optionsPtr;
// and then make a pointer out of the whole list
IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((Int32)list.dwSize);
IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((int)list.dwSize);
Marshal.StructureToPtr(list, ipcoListPtr, false);
// and finally, call the API method!
@@ -181,7 +209,7 @@ namespace v2rayN.HttpProxyHandler
string ProxyServer = rk.GetValue("ProxyServer").ToString();
rk.Close();
return ProxyServer;
}
}
}
@@ -1,182 +0,0 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using Newtonsoft.Json;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.Tool;
namespace v2rayN.HttpProxyHandler
{
class SysProxyHandle
{
private const string _userWininetConfigFile = "user-wininet.json";
private static string _queryStr;
// In general, this won't change
// format:
// <flags><CR-LF>
// <proxy-server><CR-LF>
// <bypass-list><CR-LF>
// <pac-url>
private static SysproxyConfig _userSettings = null;
enum RET_ERRORS : int
{
RET_NO_ERROR = 0,
INVALID_FORMAT = 1,
NO_PERMISSION = 2,
SYSCALL_FAILED = 3,
NO_MEMORY = 4,
INVAILD_OPTION_COUNT = 5,
};
static SysProxyHandle()
{
try
{
FileManager.UncompressFile(Utils.GetTempPath("sysproxy.exe"),
Environment.Is64BitOperatingSystem ? Resources.sysproxy64_exe : Resources.sysproxy_exe);
}
catch (IOException ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
public static void SetIEProxy(bool enable, bool global, string proxyServer, string pacURL)
{
Read();
if (!_userSettings.UserSettingsRecorded)
{
// record user settings
ExecSysproxy("query");
ParseQueryStr(_queryStr);
}
string arguments;
if (enable)
{
arguments = global
? string.Format(
//"global {0} <local>;localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*;192.168.*",
"global {0} <local>;localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*",
proxyServer)
: string.Format("pac {0}", pacURL);
}
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);
// have to get new settings
_userSettings.UserSettingsRecorded = false;
}
Save();
ExecSysproxy(arguments);
}
private static void ExecSysproxy(string arguments)
{
using (var process = new Process())
{
// Configure the process using the StartInfo properties.
process.StartInfo.FileName = Utils.GetTempPath("sysproxy.exe");
process.StartInfo.Arguments = arguments;
process.StartInfo.WorkingDirectory = Utils.GetTempPath();
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardOutput = true;
// Need to provide encoding info, or output/error strings we got will be wrong.
process.StartInfo.StandardOutputEncoding = Encoding.Unicode;
process.StartInfo.StandardErrorEncoding = Encoding.Unicode;
process.StartInfo.CreateNoWindow = true;
process.Start();
var stderr = process.StandardError.ReadToEnd();
var stdout = process.StandardOutput.ReadToEnd();
process.WaitForExit();
var exitCode = process.ExitCode;
if (exitCode != (int)RET_ERRORS.RET_NO_ERROR)
{
throw new Exception(stderr);
}
if (arguments == "query")
{
if (stdout.IsNullOrWhiteSpace() || stdout.IsNullOrEmpty())
{
// we cannot get user settings
throw new Exception("failed to query wininet settings");
}
_queryStr = stdout;
}
}
}
private static void Save()
{
try
{
using (StreamWriter sw = new StreamWriter(File.Open(Utils.GetPath(_userWininetConfigFile), FileMode.Create)))
{
string jsonString = JsonConvert.SerializeObject(_userSettings, Formatting.Indented);
sw.Write(jsonString);
sw.Flush();
}
}
catch (IOException ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private static void Read()
{
try
{
string configContent = File.ReadAllText(Utils.GetPath(_userWininetConfigFile));
_userSettings = JsonConvert.DeserializeObject<SysproxyConfig>(configContent);
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
// Suppress all exceptions. finally block will initialize new user config settings.
}
finally
{
if (_userSettings == null) _userSettings = new SysproxyConfig();
}
}
private static void ParseQueryStr(string str)
{
string[] userSettingsArr = str.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
_userSettings.Flags = userSettingsArr[0];
// handle output from WinINET
if (userSettingsArr[1] == "(null)") _userSettings.ProxyServer = null;
else _userSettings.ProxyServer = userSettingsArr[1];
if (userSettingsArr[2] == "(null)") _userSettings.BypassList = null;
else _userSettings.BypassList = userSettingsArr[2];
if (userSettingsArr[3] == "(null)") _userSettings.PacUrl = null;
else _userSettings.PacUrl = userSettingsArr[3];
_userSettings.UserSettingsRecorded = true;
}
}
}
@@ -1,22 +0,0 @@
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;
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+251 -63
View File
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using v2rayN.Base;
namespace v2rayN.Mode
{
@@ -13,96 +13,166 @@ 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>
/// 启用Http代理
/// 监听状态 0-not 1-http 2-PAC
/// </summary>
public bool sysAgentEnabled { get; set; }
/// <summary>
/// 监听状态 0-不改变 1-全局 2-PAC
/// </summary>
public int listenerType { get; set; }
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;
}
/// <summary>
/// 视图刷新率
/// </summary>
public int statisticsFreshRate
{
get; set;
}
/// <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;
}
public List<string> userPacRule
{
get; set;
}
#region
@@ -112,7 +182,7 @@ namespace v2rayN.Mode
{
return string.Empty;
}
return vmess[index].address.Trim();
return vmess[index].address.TrimEx();
}
public int port()
@@ -130,7 +200,7 @@ namespace v2rayN.Mode
{
return string.Empty;
}
return vmess[index].id.Trim();
return vmess[index].id.TrimEx();
}
public int alterId()
@@ -148,7 +218,7 @@ namespace v2rayN.Mode
{
return string.Empty;
}
return vmess[index].security.Trim();
return vmess[index].security.TrimEx();
}
public string remarks()
@@ -157,7 +227,7 @@ namespace v2rayN.Mode
{
return string.Empty;
}
return vmess[index].remarks.Trim();
return vmess[index].remarks.TrimEx();
}
public string network()
{
@@ -165,7 +235,7 @@ namespace v2rayN.Mode
{
return Global.DefaultNetwork;
}
return vmess[index].network.Trim();
return vmess[index].network.TrimEx();
}
public string headerType()
{
@@ -173,7 +243,7 @@ namespace v2rayN.Mode
{
return Global.None;
}
return vmess[index].headerType.Replace(" ", "").Trim();
return vmess[index].headerType.Replace(" ", "").TrimEx();
}
public string requestHost()
{
@@ -181,7 +251,7 @@ namespace v2rayN.Mode
{
return string.Empty;
}
return vmess[index].requestHost.Replace(" ", "").Trim();
return vmess[index].requestHost.Replace(" ", "").TrimEx();
}
public string path()
{
@@ -189,7 +259,7 @@ namespace v2rayN.Mode
{
return string.Empty;
}
return vmess[index].path.Replace(" ", "").Trim();
return vmess[index].path.Replace(" ", "").TrimEx();
}
public string streamSecurity()
{
@@ -210,6 +280,19 @@ 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)
{
@@ -240,6 +323,16 @@ namespace v2rayN.Mode
return vmess[index].getSummary();
}
public string getItemId()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].getItemId();
}
#endregion
}
@@ -323,80 +416,136 @@ 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]
@@ -405,17 +554,26 @@ 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>
/// 开启流量探测
@@ -429,31 +587,52 @@ 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;
}
}
@@ -463,17 +642,26 @@ 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
+43
View File
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
namespace v2rayN.Mode
{
[Serializable]
public class ServerStatistics
{
public List<ServerStatItem> server
{
get; set;
}
}
[Serializable]
public class ServerStatItem
{
public string itemId
{
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;
}
}
}
+38
View File
@@ -21,6 +21,17 @@ namespace v2rayN.Mode
/// </summary>
public List<Outbounds> outbounds { get; set; }
/// <summary>
/// 统计需要, 空对象
/// </summary>
public Stats stats { get; set; }
/// </summary>
public API api { get; set; }
/// </summary>
public Policy policy;
/// <summary>
/// DNS 配置
/// </summary>
@@ -31,6 +42,25 @@ namespace v2rayN.Mode
public Routing routing { get; set; }
}
public class Stats { };
public class API
{
public string tag { get; set; }
public List<string> services { get; set; }
}
public class Policy
{
public SystemPolicy system;
}
public class SystemPolicy
{
public bool statsInboundUplink;
public bool statsInboundDownlink;
}
public class Log
{
/// <summary>
@@ -49,6 +79,7 @@ namespace v2rayN.Mode
public class Inbounds
{
public string tag { get; set; }
/// <summary>
///
/// </summary>
@@ -92,6 +123,11 @@ namespace v2rayN.Mode
/// </summary>
public string ip { get; set; }
/// <summary>
/// api 使用
/// </summary>
public string address { get; set; }
/// <summary>
///
/// </summary>
@@ -273,6 +309,8 @@ namespace v2rayN.Mode
///
/// </summary>
public string port { get; set; }
public List<string> inboundTag { get; set; }
/// <summary>
///
/// </summary>
+1 -1
View File
@@ -49,5 +49,5 @@ namespace v2rayN.Mode
/// 底层传输安全
/// </summary>
public string tls { get; set; } = string.Empty;
}
}
}
+49 -25
View File
@@ -3,6 +3,8 @@ using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;
using v2rayN.Forms;
using v2rayN.Properties;
using v2rayN.Tool;
namespace v2rayN
{
@@ -26,13 +28,20 @@ namespace v2rayN
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
//AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
Process instance = RunningInstance();
if (instance == null)
{
Utils.SaveLog("v2rayN start up");
{
if (!UnzipLibs())
{
UI.Show($"Error preparing the environment(准备运行环境出错)");
return;
}
Utils.SaveLog("v2rayN start up");
//设置语言环境
string lang = Utils.RegReadValue(Global.MyRegPath, Global.MyRegKeyLanguage, "zh-Hans");
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang);
@@ -43,31 +52,31 @@ namespace v2rayN
}
else
{
UI.Show("v2rayN is already running(v2rayN已经运行)");
UI.Show($"v2rayN is already running(v2rayN已经运行)");
}
}
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
try
{
string resourceName = "v2rayN." + new AssemblyName(args.Name).Name + ".dll";
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
{
if (stream == null)
{
return null;
}
byte[] assemblyData = new byte[stream.Length];
stream.Read(assemblyData, 0, assemblyData.Length);
return Assembly.Load(assemblyData);
}
}
catch
{
return null;
}
}
//private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
//{
// try
// {
// string resourceName = "v2rayN.LIB." + new AssemblyName(args.Name).Name + ".dll";
// using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
// {
// if (stream == null)
// {
// return null;
// }
// byte[] assemblyData = new byte[stream.Length];
// stream.Read(assemblyData, 0, assemblyData.Length);
// return Assembly.Load(assemblyData);
// }
// }
// catch
// {
// return null;
// }
//}
/// <summary>
/// 获取正在运行的实例,没有运行的实例返回null;
@@ -99,5 +108,20 @@ namespace v2rayN
Utils.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject);
}
static bool UnzipLibs()
{
var fileName = Utils.GetPath("libs.zip");
if (!FileManager.ByteArrayToFile(fileName, Resources.libs))
{
return false;
}
if (!FileManager.ZipExtractToFile(fileName))
{
return false;
}
return true;
}
}
}
+1 -1
View File
@@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
// 方法是按如下所示使用“*”:
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("2.35")]
[assembly: AssemblyFileVersion("3.3")]
+13 -22
View File
@@ -103,9 +103,9 @@ namespace v2rayN.Properties {
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] mgwz_dll {
internal static byte[] libs {
get {
object obj = ResourceManager.GetObject("mgwz_dll", resourceCulture);
object obj = ResourceManager.GetObject("libs", resourceCulture);
return ((byte[])(obj));
}
}
@@ -120,6 +120,16 @@ namespace v2rayN.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap notify {
get {
object obj = ResourceManager.GetObject("notify", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
@@ -147,6 +157,7 @@ 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>
@@ -205,25 +216,5 @@ namespace v2rayN.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] sysproxy_exe {
get {
object obj = ResourceManager.GetObject("sysproxy_exe", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] sysproxy64_exe {
get {
object obj = ResourceManager.GetObject("sysproxy64_exe", resourceCulture);
return ((byte[])(obj));
}
}
}
}
+5 -8
View File
@@ -130,12 +130,15 @@
<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 name="libs" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\lib\libs.zip;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>
@@ -160,10 +163,4 @@
<data name="sub" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\sub.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sysproxy64_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sysproxy64.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="sysproxy_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sysproxy.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
+53
View File
@@ -0,0 +1,53 @@
syntax = "proto3";
package v2ray.core.app.stats.command;
option csharp_namespace = "v2rayN.Protos.Statistics";
message GetStatsRequest {
// Name of the stat counter.
string name = 1;
// Whether or not to reset the counter to fetching its value.
bool reset = 2;
}
message Stat {
string name = 1;
int64 value = 2;
}
message GetStatsResponse {
Stat stat = 1;
}
message QueryStatsRequest {
string pattern = 1;
bool reset = 2;
}
message QueryStatsResponse {
repeated Stat stat = 1;
}
message SysStatsRequest {
}
message SysStatsResponse {
uint32 NumGoroutine = 1;
uint32 NumGC = 2;
uint64 Alloc = 3;
uint64 TotalAlloc = 4;
uint64 Sys = 5;
uint64 Mallocs = 6;
uint64 Frees = 7;
uint64 LiveObjects = 8;
uint64 PauseTotalNs = 9;
uint32 Uptime = 10;
}
service StatsService {
rpc GetStats(GetStatsRequest) returns (GetStatsResponse) {}
rpc QueryStats(QueryStatsRequest) returns (QueryStatsResponse) {}
rpc GetSysStats(SysStatsRequest) returns (SysStatsResponse) {}
}
message Config {}
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

+25 -457
View File
@@ -49,7 +49,7 @@ var rules = [
"|http://img.dlsite.jp/",
"||dm530.net",
"share.dmhy.org",
"@@|https://share.dmhy.org",
"||dmhy.org",
"||dmm.co.jp",
"|http://www.dmm.com/netgame",
"||dnvod.tv",
@@ -262,19 +262,25 @@ var rules = [
"||daum.net",
"||depositphotos.com",
"||disconnect.me",
"||documentingreality.com",
"||doubibackup.com",
"||doubmirror.cf",
"||encyclopedia.com",
"||fangeqiang.com",
"||fanqiangdang.com",
"||cloud.feedly.com",
"||feedx.net",
"||flyzy2005.com",
"||foreignpolicy.com",
"||free-ss.site",
"||freehongkong.org",
"||blog.fuckgfw233.org",
"||g0v.social",
"||globalvoices.org",
"||glorystar.me",
"||goregrish.com",
"||guangnianvpn.com",
"||hanime.tv",
"||hbo.com",
"||spaces.hightail.com",
"||hkgalden.com",
@@ -288,6 +294,7 @@ var rules = [
"||joinmastodon.org",
"||liangzhichuanmei.com",
"||lighti.me",
"||lightyearvpn.com",
"||lihkg.com",
"||line-scdn.net",
"||i.lithium.com",
@@ -325,6 +332,7 @@ var rules = [
"||api.pureapk.com",
"||quora.com",
"||quoracdn.net",
"||qz.com",
"||cdn.seatguru.com",
"||secure.raxcdn.com",
"||redd.it",
@@ -368,6 +376,8 @@ var rules = [
"||steemit.com",
"||taiwanjustice.net",
"||tinc-vpn.org",
"||u15.info",
"||washingtonpost.com",
"||wenzhao.ca",
"||whatsonweibo.com",
"||wire.com",
@@ -375,6 +385,7 @@ var rules = [
"||xm.com",
"||xuehua.us",
"||yes-news.com",
"||yigeni.com",
"||you-get.org",
"||zzcloud.me",
"||aex.com",
@@ -697,459 +708,8 @@ var rules = [
"||thefacebook.com",
"||whatsapp.com",
"||whatsapp.net",
"|https://www.ftchinese.com",
".ftchinese.com/channel/video",
".ftchinese.com/premium/001081066",
".ftchinese.com/story/00102753",
".ftchinese.com/story/001026616",
".ftchinese.com/story/001026749",
".ftchinese.com/story/001026807",
".ftchinese.com/story/001026808",
".ftchinese.com/story/001026834",
".ftchinese.com/story/001026880",
".ftchinese.com/story/001027429",
".ftchinese.com/story/001030341",
".ftchinese.com/story/001030502",
".ftchinese.com/story/001030803",
".ftchinese.com/story/001031317",
".ftchinese.com/story/001032617",
".ftchinese.com/story/001032636",
".ftchinese.com/story/001032692",
".ftchinese.com/story/001032762",
".ftchinese.com/story/001033138",
".ftchinese.com/story/001034917",
".ftchinese.com/story/001034926",
".ftchinese.com/story/001034927",
".ftchinese.com/story/001034928",
".ftchinese.com/story/001034952",
".ftchinese.com/story/001035890",
".ftchinese.com/story/001035972",
".ftchinese.com/story/001035993",
".ftchinese.com/story/001036417",
".ftchinese.com/story/001037090",
".ftchinese.com/story/001037091",
".ftchinese.com/story/001038178",
".ftchinese.com/story/001038199",
".ftchinese.com/story/001038220",
".ftchinese.com/story/001038819",
".ftchinese.com/story/001038862",
".ftchinese.com/story/001039067",
".ftchinese.com/story/001039178",
".ftchinese.com/story/001039211",
".ftchinese.com/story/001039271",
".ftchinese.com/story/001039295",
".ftchinese.com/story/001039369",
".ftchinese.com/story/001039482",
".ftchinese.com/story/001039534",
".ftchinese.com/story/001039555",
".ftchinese.com/story/001039576",
".ftchinese.com/story/001039712",
".ftchinese.com/story/001039779",
".ftchinese.com/story/001039809",
".ftchinese.com/story/001040134",
".ftchinese.com/story/001040835",
".ftchinese.com/story/001040890",
".ftchinese.com/story/001040918",
".ftchinese.com/story/001040992",
".ftchinese.com/story/001041209",
".ftchinese.com/story/001042100",
".ftchinese.com/story/001042252",
".ftchinese.com/story/001042272",
".ftchinese.com/story/001042280",
".ftchinese.com/story/001043029",
".ftchinese.com/story/001043066",
".ftchinese.com/story/001043096",
".ftchinese.com/story/001043124",
".ftchinese.com/story/001043152",
".ftchinese.com/story/001043189",
".ftchinese.com/story/001043428",
".ftchinese.com/story/001043439",
".ftchinese.com/story/001043534",
".ftchinese.com/story/001043675",
".ftchinese.com/story/001043680",
".ftchinese.com/story/001043702",
".ftchinese.com/story/001043849",
".ftchinese.com/story/001044099",
".ftchinese.com/story/001044776",
".ftchinese.com/story/001044871",
".ftchinese.com/story/001044897",
".ftchinese.com/story/001045114",
".ftchinese.com/story/001045139",
".ftchinese.com/story/001045186",
".ftchinese.com/story/001045755",
".ftchinese.com/story/001046087",
".ftchinese.com/story/001046105",
".ftchinese.com/story/001046118",
".ftchinese.com/story/001046132",
".ftchinese.com/story/001046517",
".ftchinese.com/story/001046822",
".ftchinese.com/story/001046866",
".ftchinese.com/story/001046942",
".ftchinese.com/story/001047180",
".ftchinese.com/story/001047206",
".ftchinese.com/story/001047304",
".ftchinese.com/story/001047317",
".ftchinese.com/story/001047345",
".ftchinese.com/story/001047358",
".ftchinese.com/story/001047375",
".ftchinese.com/story/001047381",
".ftchinese.com/story/001047413",
".ftchinese.com/story/001047456",
".ftchinese.com/story/001047491",
".ftchinese.com/story/001047545",
".ftchinese.com/story/001047558",
".ftchinese.com/story/001047568",
".ftchinese.com/story/001047627",
".ftchinese.com/story/001048293",
".ftchinese.com/story/001048343",
".ftchinese.com/story/001048710",
".ftchinese.com/story/001049289",
".ftchinese.com/story/001049360",
".ftchinese.com/story/001049896",
".ftchinese.com/story/001050152",
".ftchinese.com/story/001051027",
".ftchinese.com/story/001051161",
".ftchinese.com/story/001051372",
".ftchinese.com/story/001051479",
".ftchinese.com/story/001052138",
".ftchinese.com/story/001052161",
".ftchinese.com/story/001052525",
".ftchinese.com/story/001052549",
".ftchinese.com/story/001052701",
".ftchinese.com/story/001052965",
".ftchinese.com/story/001053149",
".ftchinese.com/story/001053150",
".ftchinese.com/story/001053200",
".ftchinese.com/story/001053425",
".ftchinese.com/story/001053496",
".ftchinese.com/story/001053526",
".ftchinese.com/story/001053557",
".ftchinese.com/story/001053906",
".ftchinese.com/story/001054049",
".ftchinese.com/story/001054103",
".ftchinese.com/story/001054109",
".ftchinese.com/story/001054119",
".ftchinese.com/story/001054123",
".ftchinese.com/story/001054139",
".ftchinese.com/story/001054166",
".ftchinese.com/story/001054168",
".ftchinese.com/story/001054190",
".ftchinese.com/story/001054437",
".ftchinese.com/story/001054526",
".ftchinese.com/story/001054607",
".ftchinese.com/story/001054644",
".ftchinese.com/story/001054786",
".ftchinese.com/story/001054843",
".ftchinese.com/story/001054925",
".ftchinese.com/story/001054940",
".ftchinese.com/story/001055051",
".ftchinese.com/story/001055063",
".ftchinese.com/story/001055069",
".ftchinese.com/story/001055136",
".ftchinese.com/story/001055170",
".ftchinese.com/story/001055202",
".ftchinese.com/story/001055242",
".ftchinese.com/story/001055263",
".ftchinese.com/story/001055274",
".ftchinese.com/story/001055299",
".ftchinese.com/story/001055480",
".ftchinese.com/story/001055551",
".ftchinese.com/story/001055559",
".ftchinese.com/story/001055566",
".ftchinese.com/story/001055840",
".ftchinese.com/story/001056099",
".ftchinese.com/story/001056108",
".ftchinese.com/story/001056131",
".ftchinese.com/story/001056375",
".ftchinese.com/story/001056491",
".ftchinese.com/story/001056529",
".ftchinese.com/story/001056534",
".ftchinese.com/story/001056538",
".ftchinese.com/story/001056541",
".ftchinese.com/story/001056554",
".ftchinese.com/story/001056557",
".ftchinese.com/story/001056560",
".ftchinese.com/story/001056567",
".ftchinese.com/story/001056574",
".ftchinese.com/story/001056588",
".ftchinese.com/story/001056594",
".ftchinese.com/story/001056596",
".ftchinese.com/story/001056684",
".ftchinese.com/story/001056832",
".ftchinese.com/story/001056833",
".ftchinese.com/story/001056851",
".ftchinese.com/story/001056874",
".ftchinese.com/story/001056896",
".ftchinese.com/story/001056927",
".ftchinese.com/story/001057011",
".ftchinese.com/story/001057018",
".ftchinese.com/story/001057044",
".ftchinese.com/story/001057162",
".ftchinese.com/story/001057500",
".ftchinese.com/story/001057504",
".ftchinese.com/story/001057509",
".ftchinese.com/story/001057518",
".ftchinese.com/story/001057532",
".ftchinese.com/story/001057533",
".ftchinese.com/story/001057556",
".ftchinese.com/story/001057580",
".ftchinese.com/story/001057638",
".ftchinese.com/story/001057644",
".ftchinese.com/story/001057817",
".ftchinese.com/story/001057875",
".ftchinese.com/story/001058009",
".ftchinese.com/story/001058056",
".ftchinese.com/story/001058224",
".ftchinese.com/story/001058257",
".ftchinese.com/story/001058295",
".ftchinese.com/story/001058328",
".ftchinese.com/story/001058339",
".ftchinese.com/story/001058344",
".ftchinese.com/story/001058352",
".ftchinese.com/story/001058413",
".ftchinese.com/story/001058421",
".ftchinese.com/story/001058440",
".ftchinese.com/story/001058458",
".ftchinese.com/story/001058468",
".ftchinese.com/story/001058561",
".ftchinese.com/story/001058566",
".ftchinese.com/story/001058567",
".ftchinese.com/story/001058585",
".ftchinese.com/story/001058628",
".ftchinese.com/story/001058656",
".ftchinese.com/story/001058665",
".ftchinese.com/story/001058678",
".ftchinese.com/story/001058691",
".ftchinese.com/story/001058721",
".ftchinese.com/story/001058728",
".ftchinese.com/story/001059464",
".ftchinese.com/story/001059484",
".ftchinese.com/story/001059537",
".ftchinese.com/story/001059538",
".ftchinese.com/story/001059551",
".ftchinese.com/story/001059818",
".ftchinese.com/story/001059914",
".ftchinese.com/story/001059920",
".ftchinese.com/story/001059957",
".ftchinese.com/story/001060088",
".ftchinese.com/story/001060156",
".ftchinese.com/story/001060157",
".ftchinese.com/story/001060160",
".ftchinese.com/story/001060181",
".ftchinese.com/story/001060185",
".ftchinese.com/story/001060493",
".ftchinese.com/story/001060495",
".ftchinese.com/story/001060590",
".ftchinese.com/story/001060846",
".ftchinese.com/story/001060847",
".ftchinese.com/story/001060875",
".ftchinese.com/story/001060921",
".ftchinese.com/story/001060946",
".ftchinese.com/story/001061120",
".ftchinese.com/story/001061474",
".ftchinese.com/story/001061524",
".ftchinese.com/story/001061642",
".ftchinese.com/story/001062017",
".ftchinese.com/story/001062020",
".ftchinese.com/story/001062028",
".ftchinese.com/story/001062092",
".ftchinese.com/story/001062096",
".ftchinese.com/story/001062147",
".ftchinese.com/story/001062176",
".ftchinese.com/story/001062188",
".ftchinese.com/story/001062254",
".ftchinese.com/story/001062374",
".ftchinese.com/story/001062482",
".ftchinese.com/story/001062496",
".ftchinese.com/story/001062501",
".ftchinese.com/story/001062508",
".ftchinese.com/story/001062519",
".ftchinese.com/story/001062554",
".ftchinese.com/story/001062741",
".ftchinese.com/story/001062794",
".ftchinese.com/story/001063160",
".ftchinese.com/story/001063359",
".ftchinese.com/story/001063512",
".ftchinese.com/story/001063668",
".ftchinese.com/story/001063692",
".ftchinese.com/story/001063763",
".ftchinese.com/story/001063764",
".ftchinese.com/story/001063826",
".ftchinese.com/story/001064127",
".ftchinese.com/story/001064312",
".ftchinese.com/story/001064705",
".ftchinese.com/story/001064807",
".ftchinese.com/story/001065120",
".ftchinese.com/story/001065168",
".ftchinese.com/story/001065249",
".ftchinese.com/story/001065287",
".ftchinese.com/story/001065335",
".ftchinese.com/story/001065337",
".ftchinese.com/story/001065541",
".ftchinese.com/story/001065715",
".ftchinese.com/story/001065735",
".ftchinese.com/story/001065756",
".ftchinese.com/story/001065802",
".ftchinese.com/story/001066112",
".ftchinese.com/story/001066136",
".ftchinese.com/story/001066140",
".ftchinese.com/story/001066465",
".ftchinese.com/story/001066881",
".ftchinese.com/story/001066950",
".ftchinese.com/story/001066959",
".ftchinese.com/story/001067435",
"www.ftchinese.com/story/001067479",
".ftchinese.com/story/001067528",
".ftchinese.com/story/001067545",
".ftchinese.com/story/001067572",
".ftchinese.com/story/001067648",
".ftchinese.com/story/001067650",
".ftchinese.com/story/001067680",
".ftchinese.com/story/001067692",
".ftchinese.com/story/001067871",
".ftchinese.com/story/001067923",
".ftchinese.com/story/001068062",
".ftchinese.com/story/001068248",
".ftchinese.com/story/001068278",
".ftchinese.com/story/001068379",
".ftchinese.com/story/001068483",
".ftchinese.com/story/001068506",
".ftchinese.com/story/001068547",
".ftchinese.com/story/001068616",
".ftchinese.com/story/001068622",
".ftchinese.com/story/001068707",
".ftchinese.com/story/001069146",
".ftchinese.com/story/001069373",
".ftchinese.com/story/001069516",
".ftchinese.com/story/001069517",
".ftchinese.com/story/001069687",
".ftchinese.com/story/001069741",
".ftchinese.com/story/001069861",
".ftchinese.com/story/001069952",
".ftchinese.com/story/001070053",
".ftchinese.com/story/001070177",
".ftchinese.com/story/001070307",
".ftchinese.com/story/001070809",
".ftchinese.com/story/001070990",
".ftchinese.com/story/001071042",
".ftchinese.com/story/001071044",
".ftchinese.com/story/001071106",
".ftchinese.com/story/001071166",
".ftchinese.com/story/001071181",
"ftchinese.com/story/001071200",
".ftchinese.com/story/001071208",
".ftchinese.com/story/001071238",
".ftchinese.com/story/001071683",
".ftchinese.com/story/001072271",
".ftchinese.com/story/001072348",
".ftchinese.com/story/001072677",
".ftchinese.com/story/001072726",
".ftchinese.com/story/001072794",
".ftchinese.com/story/001072853",
".ftchinese.com/story/001072895",
".ftchinese.com/story/001072993",
".ftchinese.com/story/001073043",
".ftchinese.com/story/001073103",
".ftchinese.com/story/001073157",
".ftchinese.com/story/001073216",
".ftchinese.com/story/001073246",
".ftchinese.com/story/001073305",
".ftchinese.com/story/001073307",
".ftchinese.com/story/001073408",
".ftchinese.com/story/001073537",
".ftchinese.com/story/001073672",
".ftchinese.com/story/001073849",
".ftchinese.com/story/001073906",
".ftchinese.com/story/001074089",
".ftchinese.com/story/001074110",
".ftchinese.com/story/001074128",
".ftchinese.com/story/001074157",
".ftchinese.com/story/001074246",
".ftchinese.com/story/001074307",
".ftchinese.com/story/001074347",
".ftchinese.com/story/001074423",
".ftchinese.com/story/001074454",
".ftchinese.com/story/001074467",
".ftchinese.com/story/001074493",
".ftchinese.com/story/001074550",
".ftchinese.com/story/001074562",
".ftchinese.com/story/001074653",
".ftchinese.com/story/001074693",
".ftchinese.com/story/001074699",
".ftchinese.com/story/001074712",
".ftchinese.com/story/001074713",
".ftchinese.com/story/001074768",
".ftchinese.com/story/001074782",
".ftchinese.com/story/001074794",
".ftchinese.com/story/001074822",
".ftchinese.com/story/001074874",
".ftchinese.com/story/001074891",
".ftchinese.com/story/001074918",
".ftchinese.com/story/001075081",
".ftchinese.com/story/001075134",
".ftchinese.com/story/001075142",
".ftchinese.com/story/001075216",
".ftchinese.com/story/001075230",
".ftchinese.com/story/001075238",
".ftchinese.com/story/001075262",
".ftchinese.com/story/001075269",
".ftchinese.com/story/001075491",
".ftchinese.com/story/001075500",
".ftchinese.com/story/001075650",
".ftchinese.com/story/001075678",
".ftchinese.com/story/001075703",
".ftchinese.com/story/001075739",
".ftchinese.com/story/001076066",
".ftchinese.com/story/001076142",
".ftchinese.com/story/001076459",
".ftchinese.com/story/001076470",
".ftchinese.com/story/001076538",
".ftchinese.com/story/001076573",
".ftchinese.com/story/001076901",
".ftchinese.com/story/001077067",
".ftchinese.com/story/001077084",
".ftchinese.com/story/001077235",
".ftchinese.com/story/001077344",
".ftchinese.com/story/001077390",
".ftchinese.com/story/001077392",
".ftchinese.com/story/001077465",
".ftchinese.com/story/001077468",
".ftchinese.com/story/001077492",
".ftchinese.com/story/001077745",
".ftchinese.com/story/001077768",
".ftchinese.com/story/001077804",
".ftchinese.com/story/001077852",
".ftchinese.com/story/001078646",
".ftchinese.com/story/001078928",
".ftchinese.com/story/001078967",
".ftchinese.com/story/001079559",
".ftchinese.com/story/001079641",
".ftchinese.com/story/001079909",
".ftchinese.com/story/001079934",
".ftchinese.com/story/001079992",
".ftchinese.com/story/001080054",
".ftchinese.com/story/001080109",
".ftchinese.com/story/001080169",
".ftchinese.com/story/001080226",
".ftchinese.com/story/001080429",
".ftchinese.com/story/001080471",
".ftchinese.com/story/001080550",
".ftchinese.com/story/001080581",
".ftchinese.com/story/001080647",
".ftchinese.com/story/001080778",
".ftchinese.com/story/001080892",
".ftchinese.com/story/001080915",
".ftchinese.com/story/001080935",
".ftchinese.com/story/001081059",
".ftchinese.com/story/001081127",
".ftchinese.com/tag/%E5%8D%81%E5%85%AB%E5%B1%8A%E4%B8%89%E4%B8%AD%E5%85%A8%E4%BC%9A",
".ftchinese.com/tag/%E6%B8%A9%E5%AE%B6%E5%AE%9D",
".ftchinese.com/tag/%E8%96%84%E7%86%99%E6%9D%A5",
".ftchinese.com/video/1437",
".ftchinese.com/video/1882",
".ftchinese.com/video/2446",
".ftchinese.com/video/2601",
".ftchinese.com/comments",
".ftchinese.com",
"||ftchinese.com",
"||1e100.net",
"||466453.com",
"||abc.xyz",
@@ -1595,6 +1155,7 @@ var rules = [
"||2008xianzhang.info",
"||2017.hk",
"21andy.com/blog",
".21join.com",
".21pron.com",
"21sextury.com",
".228.net.tw",
@@ -1636,9 +1197,10 @@ var rules = [
"64wiki.com",
".66.ca",
"666kb.com",
"6park.com",
".6park.com",
"||6park.com",
"||6parker.com",
"||6parknews.com",
"||7capture.com",
".7cow.com",
".8-d.com",
@@ -1923,6 +1485,7 @@ var rules = [
".avdb.tv",
"||avdb.tv",
".avfantasy.com",
"||avg.com",
".avgle.com",
"||avgle.com",
"||avidemux.org",
@@ -2716,6 +2279,8 @@ var rules = [
"delicious.com/GFWbookmark",
".democrats.org",
"||democrats.org",
".demosisto.hk",
"||demosisto.hk",
"||desc.se",
"||dessci.com",
".destroy-china.jp",
@@ -3416,6 +2981,7 @@ var rules = [
"||toutyrater.github.io",
"wsgzao.github.io",
"|https://wsgzao.github.io",
"||raw.githubusercontent.com",
".gizlen.net",
"||gizlen.net",
".gjczz.com",
@@ -4390,7 +3956,7 @@ var rules = [
".lsmradio.com/rad_archives",
".lsmwebcast.com",
".ltn.com.tw",
"|http://ltn.com.tw",
"||ltn.com.tw",
".luke54.com",
".luke54.org",
".lupm.org",
@@ -4858,6 +4424,7 @@ var rules = [
"|http://nvtongzhisheng.org",
".nwtca.org",
"|http://nyaa.eu",
"||nyaa.si",
".nydus.ca",
"nylon-angel.com",
"nylonstockingsonline.com",
@@ -5321,6 +4888,7 @@ var rules = [
"||rapidmoviez.com",
"rapidvpn.com",
"||rapidvpn.com",
"||rarbgprx.org",
".raremovie.cc",
"|http://raremovie.cc",
".raremovie.net",
@@ -6861,7 +6429,7 @@ var rules = [
"||windscribe.com",
"||community.windy.com",
"||wingy.site",
"winning11.com",
".winning11.com",
"winwhispers.info",
"||wiredbytes.com",
"||wiredpen.com",
Binary file not shown.
Binary file not shown.
+1
View File
@@ -4,4 +4,5 @@ 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
Binary file not shown.
Binary file not shown.
+86 -5
View File
@@ -19,7 +19,7 @@ namespace v2rayN.Resx {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class ResUI {
@@ -47,7 +47,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 使用此强类型资源类,为所有资源查找
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
@@ -105,6 +105,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 DOWN 的本地化字符串。
/// </summary>
internal static string downloadSpeed {
get {
return ResourceManager.GetString("downloadSpeed", resourceCulture);
}
}
/// <summary>
/// 查找类似 Whether to download? {0} 的本地化字符串。
/// </summary>
@@ -321,6 +330,42 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Today download traffic 的本地化字符串。
/// </summary>
internal static string LvTodayDownloadDataAmount {
get {
return ResourceManager.GetString("LvTodayDownloadDataAmount", resourceCulture);
}
}
/// <summary>
/// 查找类似 Today upload traffic 的本地化字符串。
/// </summary>
internal static string LvTodayUploadDataAmount {
get {
return ResourceManager.GetString("LvTodayUploadDataAmount", resourceCulture);
}
}
/// <summary>
/// 查找类似 Total download traffic 的本地化字符串。
/// </summary>
internal static string LvTotalDownloadDataAmount {
get {
return ResourceManager.GetString("LvTotalDownloadDataAmount", resourceCulture);
}
}
/// <summary>
/// 查找类似 Total upload traffic 的本地化字符串。
/// </summary>
internal static string LvTotalUploadDataAmount {
get {
return ResourceManager.GetString("LvTotalUploadDataAmount", resourceCulture);
}
}
/// <summary>
/// 查找类似 Transport 的本地化字符串。
/// </summary>
@@ -330,6 +375,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 MediumFresh 的本地化字符串。
/// </summary>
internal static string MediumFresh {
get {
return ResourceManager.GetString("MediumFresh", resourceCulture);
}
}
/// <summary>
/// 查找类似 Clear original subscription content 的本地化字符串。
/// </summary>
@@ -340,7 +394,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Download V2rayCore successfully 的本地化字符串。
/// 查找类似 Download V2ray successfully 的本地化字符串。
/// </summary>
internal static string MsgDownloadV2rayCoreSuccessfully {
get {
@@ -394,7 +448,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Resolve V2rayCore successfully 的本地化字符串。
/// 查找类似 Resolve V2ray successfully 的本地化字符串。
/// </summary>
internal static string MsgParsingV2rayCoreSuccessfully {
get {
@@ -430,7 +484,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Start updating V2rayCore... 的本地化字符串。
/// 查找类似 Start updating V2ray... 的本地化字符串。
/// </summary>
internal static string MsgStartUpdatingV2rayCore {
get {
@@ -582,6 +636,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 QuickFresh 的本地化字符串。
/// </summary>
internal static string QuickFresh {
get {
return ResourceManager.GetString("QuickFresh", resourceCulture);
}
}
/// <summary>
/// 查找类似 Are you sure to remove the server? 的本地化字符串。
/// </summary>
@@ -609,6 +672,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 SlowFresh 的本地化字符串。
/// </summary>
internal static string SlowFresh {
get {
return ResourceManager.GetString("SlowFresh", resourceCulture);
}
}
/// <summary>
/// 查找类似 Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node! 的本地化字符串。
/// </summary>
@@ -618,6 +690,15 @@ 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})...... 的本地化字符串。
/// </summary>
+30 -3
View File
@@ -269,7 +269,7 @@
<value>Clear original subscription content</value>
</data>
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
<value>Download V2rayCore successfully</value>
<value>Download V2ray successfully</value>
</data>
<data name="MsgFailedImportSubscription" xml:space="preserve">
<value>Failed to import subscription content</value>
@@ -287,7 +287,7 @@
<value>PAC update succeeded</value>
</data>
<data name="MsgParsingV2rayCoreSuccessfully" xml:space="preserve">
<value>Resolve V2rayCore successfully</value>
<value>Resolve V2ray successfully</value>
</data>
<data name="MsgSimplifyPAC" xml:space="preserve">
<value>Simplify PAC Success</value>
@@ -299,7 +299,7 @@
<value>Start updating PAC...</value>
</data>
<data name="MsgStartUpdatingV2rayCore" xml:space="preserve">
<value>Start updating V2rayCore...</value>
<value>Start updating V2ray...</value>
</data>
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
<value>Subscription content decoding failed (non-BASE64 code)</value>
@@ -319,4 +319,31 @@
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
<value>Update V2rayCore successfully! Restarting service...</value>
</data>
<data name="MediumFresh" xml:space="preserve">
<value>MediumFresh</value>
</data>
<data name="QuickFresh" xml:space="preserve">
<value>QuickFresh</value>
</data>
<data name="SlowFresh" xml:space="preserve">
<value>SlowFresh</value>
</data>
<data name="downloadSpeed" xml:space="preserve">
<value>DOWN</value>
</data>
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
<value>Today download traffic</value>
</data>
<data name="LvTodayUploadDataAmount" xml:space="preserve">
<value>Today upload traffic</value>
</data>
<data name="LvTotalDownloadDataAmount" xml:space="preserve">
<value>Total download traffic</value>
</data>
<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>
</root>
+30 -3
View File
@@ -269,7 +269,7 @@
<value>清除原订阅内容</value>
</data>
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
<value>下载V2rayCore成功</value>
<value>下载V2ray成功</value>
</data>
<data name="MsgFailedImportSubscription" xml:space="preserve">
<value>导入订阅内容失败</value>
@@ -287,7 +287,7 @@
<value>PAC更新成功</value>
</data>
<data name="MsgParsingV2rayCoreSuccessfully" xml:space="preserve">
<value>解析V2rayCore成功</value>
<value>解析V2ray成功</value>
</data>
<data name="MsgSimplifyPAC" xml:space="preserve">
<value>简化PAC成功</value>
@@ -299,7 +299,7 @@
<value>开始更新PAC...</value>
</data>
<data name="MsgStartUpdatingV2rayCore" xml:space="preserve">
<value>开始更新V2rayCore...</value>
<value>开始更新V2ray...</value>
</data>
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
<value>订阅内容解码失败(非BASE64码)</value>
@@ -319,4 +319,31 @@
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
<value>更新V2rayCore成功!正在重启服务...</value>
</data>
<data name="MediumFresh" xml:space="preserve">
<value>中等</value>
</data>
<data name="QuickFresh" xml:space="preserve">
<value>快</value>
</data>
<data name="SlowFresh" xml:space="preserve">
<value>慢</value>
</data>
<data name="downloadSpeed" xml:space="preserve">
<value>下载</value>
</data>
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
<value>今日下载</value>
</data>
<data name="LvTodayUploadDataAmount" xml:space="preserve">
<value>今日上传</value>
</data>
<data name="LvTotalDownloadDataAmount" xml:space="preserve">
<value>总下载</value>
</data>
<data name="LvTotalUploadDataAmount" xml:space="preserve">
<value>总上传</value>
</data>
<data name="StartPacFailed" xml:space="preserve">
<value>PAC服务启动失败,请用管理员启动</value>
</data>
</root>
+31 -17
View File
@@ -1,25 +1,33 @@
{
{
"log": {
"access": "",
"error": "",
"loglevel": "error"
},
"log": {
"access": "Vaccess.log",
"error": "Verror.log",
"loglevel": "warning"
},
"inbounds": [{
"port": 10808,
"protocol": "socks",
"listen": "127.0.0.1",
"settings": {
"auth": "noauth",
"udp": true
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
"inbounds": [
{
"tag": "proxy",
"port": 10808,
"protocol": "socks",
"listen": "127.0.0.1",
"settings": {
"auth": "noauth",
"udp": true
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
}],
],
"outbounds": [{
"tag": "proxy",
"protocol": "vmess",
@@ -66,6 +74,12 @@
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": []
"rules": [
{
"inboundTag": ["api"],
"outboundTag": "api",
"type": "field"
}
]
}
}
@@ -0,0 +1 @@
geosite:category-ads,
+132
View File
@@ -0,0 +1,132 @@
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
@@ -0,0 +1,33 @@
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,
+73 -10
View File
@@ -24,20 +24,27 @@ namespace v2rayN.Tool
public static void UncompressFile(string fileName, byte[] content)
{
// Because the uncompressed size of the file is unknown,
// we are using an arbitrary buffer size.
byte[] buffer = new byte[4096];
int n;
using (var fs = File.Create(fileName))
using (var input = new GZipStream(new MemoryStream(content),
CompressionMode.Decompress, false))
try
{
while ((n = input.Read(buffer, 0, buffer.Length)) > 0)
// Because the uncompressed size of the file is unknown,
// we are using an arbitrary buffer size.
byte[] buffer = new byte[4096];
int n;
using (var fs = File.Create(fileName))
using (var input = new GZipStream(new MemoryStream(content),
CompressionMode.Decompress, false))
{
fs.Write(buffer, 0, n);
while ((n = input.Read(buffer, 0, buffer.Length)) > 0)
{
fs.Write(buffer, 0, n);
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
public static string NonExclusiveReadAllText(string path)
@@ -61,5 +68,61 @@ namespace v2rayN.Tool
throw ex;
}
}
public static bool ZipExtractToFile(string fileName)
{
try
{
using (ZipArchive archive = ZipFile.OpenRead(fileName))
{
foreach (ZipArchiveEntry entry in archive.Entries)
{
if (entry.Length == 0)
{
continue;
}
try
{
entry.ExtractToFile(Utils.GetPath(entry.Name), true);
}
catch (IOException ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return false;
}
return true;
}
public static bool ZipExtractToFullFile(string fileName)
{
try
{
using (ZipArchive archive = ZipFile.OpenRead(fileName))
{
foreach (ZipArchiveEntry entry in archive.Entries)
{
if (entry.Length == 0)
continue;
string entryOuputPath = Utils.GetPath(entry.FullName);
FileInfo fileInfo = new FileInfo(entryOuputPath);
fileInfo.Directory.Create();
entry.ExtractToFile(entryOuputPath, true);
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return false;
}
return true;
}
}
}
+1 -1
View File
@@ -54,7 +54,7 @@ namespace v2rayN
if (!succ)
{
//Logging.Error("Failed to call AssignProcessToJobObject! GetLastError=" + Marshal.GetLastWin32Error());
Utils.SaveLog("Failed to call AssignProcessToJobObject! GetLastError=" + Marshal.GetLastWin32Error());
}
return succ;
+103 -21
View File
@@ -18,6 +18,7 @@ using ZXing;
using ZXing.Common;
using ZXing.QrCode;
using System.Security.Principal;
using v2rayN.Base;
namespace v2rayN
{
@@ -154,7 +155,7 @@ namespace v2rayN
{
if (wrap)
{
return string.Join(",\r\n", lst.ToArray());
return string.Join("," + Environment.NewLine, lst.ToArray());
}
else
{
@@ -175,7 +176,7 @@ namespace v2rayN
{
try
{
str = str.Replace("\r\n", "");
str = str.Replace(Environment.NewLine, "");
return new List<string>(str.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
}
catch
@@ -212,9 +213,9 @@ namespace v2rayN
{
try
{
plainText = plainText.Trim()
plainText = plainText.TrimEx()
.Replace(Environment.NewLine, "")
.Replace("\n", "")
.Replace("\r\n", "")
.Replace("\r", "")
.Replace(" ", "");
@@ -250,6 +251,89 @@ namespace v2rayN
}
}
public static string ToString(object obj)
{
try
{
return (obj == null ? string.Empty : obj.ToString());
}
catch
{
return string.Empty;
}
}
/// <summary>
/// byte 转成 有两位小数点的 方便阅读的数据
/// 比如 2.50 MB
/// </summary>
/// <param name="amount">bytes</param>
/// <param name="result">转换之后的数据</param>
/// <param name="unit">单位</param>
public static void ToHumanReadable(ulong amount, out double result, out string unit)
{
var factor = 1024u;
var KBs = amount / factor;
if (KBs > 0)
{
// multi KB
var MBs = KBs / factor;
if (MBs > 0)
{
// multi MB
var GBs = MBs / factor;
if (GBs > 0)
{
// multi GB
var TBs = GBs / factor;
if (TBs > 0)
{
// 你是魔鬼吗? 用这么多流量
result = TBs + GBs % factor / (factor + 0.0);
unit = "TB";
return;
}
result = GBs + MBs % factor / (factor + 0.0);
unit = "GB";
return;
}
result = MBs + KBs % factor / (factor + 0.0);
unit = "MB";
return;
}
result = KBs + amount % factor / (factor + 0.0);
unit = "KB";
return;
}
else
{
result = amount;
unit = "B";
}
}
public static string HumanFy(ulong amount)
{
double result;
string unit;
ToHumanReadable(amount, out result, out unit);
return $"{string.Format("{0:f1}", result)}{unit}";
}
public static void DedupServerList(List<Mode.VmessItem> source, out List<Mode.VmessItem> result)
{
var list = new List<Mode.VmessItem>();
foreach (var item in source)
{
if (!list.Exists(i => item.address == i.address && item.port == i.port && item.path == i.path))
{
list.Add(item);
}
}
result = list;
}
#endregion
@@ -304,7 +388,7 @@ namespace v2rayN
}
//清除要验证字符串中的空格
//ip = ip.Trim();
//ip = ip.TrimEx();
//可能是CIDR
if (ip.IndexOf(@"/") > 0)
{
@@ -340,7 +424,7 @@ namespace v2rayN
}
//清除要验证字符串中的空格
//domain = domain.Trim();
//domain = domain.TrimEx();
//模式字符串
string pattern = @"^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$";
@@ -573,7 +657,14 @@ namespace v2rayN
return lstIPAddress;
}
public static void SetSecurityProtocol()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
| SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
ServicePointManager.DefaultConnectionLimit = 256;
}
#endregion
#region
@@ -695,16 +786,13 @@ namespace v2rayN
#region TempPath
private static string _tempPath = null;
// return path to store temporary files
public static string GetTempPath()
{
if (_tempPath == null)
string _tempPath = Path.Combine(StartupPath(), "v2ray_win_temp");
if (!Directory.Exists(_tempPath))
{
Directory.CreateDirectory(Path.Combine(StartupPath(), "v2ray_win_temp"));
// don't use "/", it will fail when we call explorer /select xxx/ss_win_temp\xxx.log
_tempPath = Path.Combine(StartupPath(), "v2ray_win_temp");
Directory.CreateDirectory(_tempPath);
}
return _tempPath;
}
@@ -712,13 +800,7 @@ namespace v2rayN
public static string GetTempPath(string filename)
{
return Path.Combine(GetTempPath(), filename);
}
public static void ClearTempPath()
{
//Directory.Delete(GetTempPath(), true);
//_tempPath = null;
}
}
public static string UnGzip(byte[] buf)
{
@@ -770,7 +852,7 @@ namespace v2rayN
SwWrite.WriteLine(string.Format("{0}{1}[{2}]{3}", "--------------------------------", strTitle, DateTime.Now.ToString("HH:mm:ss"), "--------------------------------"));
SwWrite.Write(strContent);
SwWrite.WriteLine("\r\n");
SwWrite.WriteLine(Environment.NewLine);
SwWrite.WriteLine(" ");
SwWrite.Flush();
SwWrite.Close();
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Grpc.Tools" version="2.24.0" targetFramework="net46" developmentDependency="true" />
</packages>
-560
View File
@@ -1,560 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: command.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace V2Ray.Core.App.Stats.Command {
/// <summary>Holder for reflection information generated from command.proto</summary>
public static partial class CommandReflection {
#region Descriptor
/// <summary>File descriptor for command.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static CommandReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cg1jb21tYW5kLnByb3RvEhx2MnJheS5jb3JlLmFwcC5zdGF0cy5jb21tYW5k",
"Ii4KD0dldFN0YXRzUmVxdWVzdBIMCgRuYW1lGAEgASgJEg0KBXJlc2V0GAIg",
"ASgIIiMKBFN0YXQSDAoEbmFtZRgBIAEoCRINCgV2YWx1ZRgCIAEoAyJEChBH",
"ZXRTdGF0c1Jlc3BvbnNlEjAKBHN0YXQYASABKAsyIi52MnJheS5jb3JlLmFw",
"cC5zdGF0cy5jb21tYW5kLlN0YXQiCAoGQ29uZmlnMnsKDFN0YXRzU2Vydmlj",
"ZRJrCghHZXRTdGF0cxItLnYycmF5LmNvcmUuYXBwLnN0YXRzLmNvbW1hbmQu",
"R2V0U3RhdHNSZXF1ZXN0Gi4udjJyYXkuY29yZS5hcHAuc3RhdHMuY29tbWFu",
"ZC5HZXRTdGF0c1Jlc3BvbnNlIgBCTAogY29tLnYycmF5LmNvcmUuYXBwLnN0",
"YXRzLmNvbW1hbmRQAVoHY29tbWFuZKoCHFYyUmF5LkNvcmUuQXBwLlN0YXRz",
"LkNvbW1hbmRiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::V2Ray.Core.App.Stats.Command.GetStatsRequest), global::V2Ray.Core.App.Stats.Command.GetStatsRequest.Parser, new[]{ "Name", "Reset" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::V2Ray.Core.App.Stats.Command.Stat), global::V2Ray.Core.App.Stats.Command.Stat.Parser, new[]{ "Name", "Value" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::V2Ray.Core.App.Stats.Command.GetStatsResponse), global::V2Ray.Core.App.Stats.Command.GetStatsResponse.Parser, new[]{ "Stat" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::V2Ray.Core.App.Stats.Command.Config), global::V2Ray.Core.App.Stats.Command.Config.Parser, null, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class GetStatsRequest : pb::IMessage<GetStatsRequest> {
private static readonly pb::MessageParser<GetStatsRequest> _parser = new pb::MessageParser<GetStatsRequest>(() => new GetStatsRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GetStatsRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::V2Ray.Core.App.Stats.Command.CommandReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetStatsRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetStatsRequest(GetStatsRequest other) : this() {
name_ = other.name_;
reset_ = other.reset_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetStatsRequest Clone() {
return new GetStatsRequest(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Name of the stat counter.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "reset" field.</summary>
public const int ResetFieldNumber = 2;
private bool reset_;
/// <summary>
/// Whether or not to reset the counter to fetching its value.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Reset {
get { return reset_; }
set {
reset_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GetStatsRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GetStatsRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (Reset != other.Reset) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Reset != false) hash ^= Reset.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (Reset != false) {
output.WriteRawTag(16);
output.WriteBool(Reset);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (Reset != false) {
size += 1 + 1;
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GetStatsRequest other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.Reset != false) {
Reset = other.Reset;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 16: {
Reset = input.ReadBool();
break;
}
}
}
}
}
public sealed partial class Stat : pb::IMessage<Stat> {
private static readonly pb::MessageParser<Stat> _parser = new pb::MessageParser<Stat>(() => new Stat());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Stat> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::V2Ray.Core.App.Stats.Command.CommandReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Stat() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Stat(Stat other) : this() {
name_ = other.name_;
value_ = other.value_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Stat Clone() {
return new Stat(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 2;
private long value_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Value {
get { return value_; }
set {
value_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Stat);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Stat other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (Value != other.Value) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Value != 0L) hash ^= Value.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (Value != 0L) {
output.WriteRawTag(16);
output.WriteInt64(Value);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (Value != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Value);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Stat other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.Value != 0L) {
Value = other.Value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 16: {
Value = input.ReadInt64();
break;
}
}
}
}
}
public sealed partial class GetStatsResponse : pb::IMessage<GetStatsResponse> {
private static readonly pb::MessageParser<GetStatsResponse> _parser = new pb::MessageParser<GetStatsResponse>(() => new GetStatsResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GetStatsResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::V2Ray.Core.App.Stats.Command.CommandReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetStatsResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetStatsResponse(GetStatsResponse other) : this() {
Stat = other.stat_ != null ? other.Stat.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetStatsResponse Clone() {
return new GetStatsResponse(this);
}
/// <summary>Field number for the "stat" field.</summary>
public const int StatFieldNumber = 1;
private global::V2Ray.Core.App.Stats.Command.Stat stat_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::V2Ray.Core.App.Stats.Command.Stat Stat {
get { return stat_; }
set {
stat_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GetStatsResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GetStatsResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Stat, other.Stat)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (stat_ != null) hash ^= Stat.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (stat_ != null) {
output.WriteRawTag(10);
output.WriteMessage(Stat);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (stat_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Stat);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GetStatsResponse other) {
if (other == null) {
return;
}
if (other.stat_ != null) {
if (stat_ == null) {
stat_ = new global::V2Ray.Core.App.Stats.Command.Stat();
}
Stat.MergeFrom(other.Stat);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
if (stat_ == null) {
stat_ = new global::V2Ray.Core.App.Stats.Command.Stat();
}
input.ReadMessage(stat_);
break;
}
}
}
}
}
public sealed partial class Config : pb::IMessage<Config> {
private static readonly pb::MessageParser<Config> _parser = new pb::MessageParser<Config>(() => new Config());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Config> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::V2Ray.Core.App.Stats.Command.CommandReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Config() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Config(Config other) : this() {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Config Clone() {
return new Config(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Config);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Config other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Config other) {
if (other == null) {
return;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
}
}
}
}
#endregion
}
#endregion Designer generated code
-97
View File
@@ -1,97 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: command.proto
// </auto-generated>
#pragma warning disable 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace V2Ray.Core.App.Stats.Command {
public static partial class StatsService
{
static readonly string __ServiceName = "v2ray.core.app.stats.command.StatsService";
static readonly grpc::Marshaller<global::V2Ray.Core.App.Stats.Command.GetStatsRequest> __Marshaller_GetStatsRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::V2Ray.Core.App.Stats.Command.GetStatsRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::V2Ray.Core.App.Stats.Command.GetStatsResponse> __Marshaller_GetStatsResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::V2Ray.Core.App.Stats.Command.GetStatsResponse.Parser.ParseFrom);
static readonly grpc::Method<global::V2Ray.Core.App.Stats.Command.GetStatsRequest, global::V2Ray.Core.App.Stats.Command.GetStatsResponse> __Method_GetStats = new grpc::Method<global::V2Ray.Core.App.Stats.Command.GetStatsRequest, global::V2Ray.Core.App.Stats.Command.GetStatsResponse>(
grpc::MethodType.Unary,
__ServiceName,
"GetStats",
__Marshaller_GetStatsRequest,
__Marshaller_GetStatsResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::V2Ray.Core.App.Stats.Command.CommandReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of StatsService</summary>
public abstract partial class StatsServiceBase
{
public virtual global::System.Threading.Tasks.Task<global::V2Ray.Core.App.Stats.Command.GetStatsResponse> GetStats(global::V2Ray.Core.App.Stats.Command.GetStatsRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for StatsService</summary>
public partial class StatsServiceClient : grpc::ClientBase<StatsServiceClient>
{
/// <summary>Creates a new client for StatsService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public StatsServiceClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for StatsService that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public StatsServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected StatsServiceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected StatsServiceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual global::V2Ray.Core.App.Stats.Command.GetStatsResponse GetStats(global::V2Ray.Core.App.Stats.Command.GetStatsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return GetStats(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::V2Ray.Core.App.Stats.Command.GetStatsResponse GetStats(global::V2Ray.Core.App.Stats.Command.GetStatsRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_GetStats, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::V2Ray.Core.App.Stats.Command.GetStatsResponse> GetStatsAsync(global::V2Ray.Core.App.Stats.Command.GetStatsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return GetStatsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::V2Ray.Core.App.Stats.Command.GetStatsResponse> GetStatsAsync(global::V2Ray.Core.App.Stats.Command.GetStatsRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_GetStats, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override StatsServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new StatsServiceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(StatsServiceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_GetStats, serviceImpl.GetStats).Build();
}
}
}
#endregion
+91 -35
View File
@@ -1,5 +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="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -74,11 +75,32 @@
<PropertyGroup />
<PropertyGroup />
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>.\Newtonsoft.Json.dll</HintPath>
<Reference Include="Google.Protobuf, Version=3.9.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\Google.Protobuf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Grpc.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\Grpc.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Grpc.Core.Api, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\Grpc.Core.Api.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\System.Buffers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -87,15 +109,28 @@
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Net" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="zxing">
<HintPath>.\zxing.dll</HintPath>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\System.Memory.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="zxing.presentation">
<HintPath>.\zxing.presentation.dll</HintPath>
<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>
<HintPath>LIB\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="zxing, Version=0.16.2.0, Culture=neutral, PublicKeyToken=4e88037ac681fe60, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\zxing.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="zxing.presentation, Version=0.16.2.0, Culture=neutral, PublicKeyToken=4e88037ac681fe60, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>LIB\zxing.presentation.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
@@ -106,6 +141,9 @@
<Compile Include="Forms\AddServer4Form.Designer.cs">
<DependentUpon>AddServer4Form.cs</DependentUpon>
</Compile>
<Compile Include="Base\ListViewFlickerFree.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\MainForm.cs">
<SubType>Form</SubType>
</Compile>
@@ -142,22 +180,28 @@
<Compile Include="Forms\SubSettingControl.Designer.cs">
<DependentUpon>SubSettingControl.cs</DependentUpon>
</Compile>
<Compile Include="Handler\V2rayUpdateHandle.cs" />
<Compile Include="HttpProxyHandler\HttpWebServer.cs" />
<Compile Include="HttpProxyHandler\HttpWebServerB.cs" />
<Compile Include="HttpProxyHandler\PACFileWatcherHandle.cs" />
<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="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="HttpProxyHandler\WebClientEx.cs">
<Compile Include="Base\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>
@@ -168,7 +212,7 @@
<DesignTime>True</DesignTime>
<DependentUpon>ResUI.resx</DependentUpon>
</Compile>
<Compile Include="StringEx.cs">
<Compile Include="Base\StringEx.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Forms\AddServerForm.cs">
@@ -185,7 +229,6 @@
</Compile>
<Compile Include="Global.cs" />
<Compile Include="Handler\QRCodeHelper.cs" />
<Compile Include="Handler\RoutingRuleHandler.cs" />
<Compile Include="Mode\VmessQRCode.cs" />
<Compile Include="Mode\V2rayTcpRequest.cs" />
<Compile Include="Handler\ConfigHandler.cs" />
@@ -243,6 +286,7 @@
</EmbeddedResource>
<EmbeddedResource Include="Forms\SubSettingControl.resx">
<DependentUpon>SubSettingControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SubSettingControl.zh-Hans.resx">
<DependentUpon>SubSettingControl.cs</DependentUpon>
@@ -279,17 +323,14 @@
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</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>
<None Include="LIB\libs.zip" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -299,10 +340,12 @@
<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\pac.txt.gz" />
<None Include="Resources\sysproxy.exe.gz" />
<None Include="Resources\sysproxy64.exe.gz" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resx\ResUI.zh-Hans.resx">
@@ -320,9 +363,6 @@
<ItemGroup>
<EmbeddedResource Include="Sample\SampleClientConfig.txt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Newtonsoft.Json.dll" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Sample\SampleHttprequest.txt" />
<EmbeddedResource Include="Sample\SampleHttpresponse.txt" />
@@ -353,7 +393,6 @@
<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>
@@ -372,19 +411,36 @@
<None Include="Resources\sub.png" />
<None Include="Resources\checkupdate.png" />
<None Include="Resources\about.png" />
<None Include="LIB\Google.Protobuf.dll" />
<None Include="LIB\Grpc.Core.Api.dll" />
<None Include="LIB\Grpc.Core.dll" />
<None Include="LIB\Newtonsoft.Json.dll" />
<None Include="LIB\System.Buffers.dll" />
<None Include="LIB\System.Memory.dll" />
<None Include="LIB\System.Runtime.CompilerServices.Unsafe.dll" />
<None Include="LIB\zxing.dll" />
<None Include="LIB\zxing.presentation.dll" />
<None Include="LIB\netstandard.dll" />
<Content Include="LIB\grpc_csharp_ext.x64.dll" />
<Content Include="LIB\grpc_csharp_ext.x86.dll" />
<Content Include="Resources\help.png" />
<None Include="Resources\notify.png" />
<Content Include="Resources\privoxy_conf.txt" />
<EmbeddedResource Include="zxing.presentation.dll" />
<EmbeddedResource Include="zxing.dll" />
</ItemGroup>
<ItemGroup>
<Folder Include="protos\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<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>
</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'))" />
</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')" />
<!-- 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">
+5
View File
@@ -14,4 +14,9 @@
<PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
</PropertyGroup>
</Project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
+106
View File
@@ -0,0 +1,106 @@
namespace v2rayUpgrade
{
partial class MainForm
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.btnClose = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.btnClose.Location = new System.Drawing.Point(367, 118);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(184, 89);
this.btnClose.TabIndex = 6;
this.btnClose.Text = "&Exit(退出)";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnOK
//
this.btnOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.btnOK.Location = new System.Drawing.Point(81, 118);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(184, 89);
this.btnOK.TabIndex = 7;
this.btnOK.Text = "&Upgrade(升级)";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(79, 64);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(205, 15);
this.label1.TabIndex = 8;
this.label1.Text = "升级成功后将自动重启v2rayN";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(79, 37);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(471, 15);
this.label2.TabIndex = 9;
this.label2.Text = "v2rayN will restart automatically after successful upgrade";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(616, 284);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.btnOK);
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "v2rayUpgrade";
this.Load += new System.EventHandler(this.MainForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
}
}
+115
View File
@@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace v2rayUpgrade
{
public partial class MainForm : Form
{
private string[] _args;
public MainForm(string[] args)
{
InitializeComponent();
_args = args;
}
private void MainForm_Load(object sender, EventArgs e)
{
}
private void btnOK_Click(object sender, EventArgs e)
{
if (_args.Length <= 0)
{
return;
}
try
{
var fileName = _args[0];
var startKey = "v2rayN/";
using (ZipArchive archive = ZipFile.OpenRead(fileName))
{
foreach (ZipArchiveEntry entry in archive.Entries)
{
if (entry.Length == 0)
{
continue;
}
var fullName = entry.FullName;
if (fullName.StartsWith(startKey))
{
fullName = fullName.Substring(startKey.Length, fullName.Length - startKey.Length);
}
string entryOuputPath = GetPath(fullName);
FileInfo fileInfo = new FileInfo(entryOuputPath);
fileInfo.Directory.Create();
entry.ExtractToFile(entryOuputPath, true);
}
}
}
catch (Exception ex)
{
MessageBox.Show("Upgrade Failed(升级失败)." + ex.StackTrace);
return;
}
MessageBox.Show("Upgrade successed(升级成功)");
try
{
Process.Start("v2rayN.exe");
}
catch
{
}
Close();
}
private void btnClose_Click(object sender, EventArgs e)
{
Close();
}
public static string GetExePath()
{
return Application.ExecutablePath;
}
public static string StartupPath()
{
try
{
string exePath = GetExePath();
return exePath.Substring(0, exePath.LastIndexOf("\\", StringComparison.Ordinal));
}
catch
{
return Application.StartupPath;
}
}
public static string GetPath(string fileName)
{
string startupPath = StartupPath();
if (string.IsNullOrEmpty(fileName))
{
return startupPath;
}
return Path.Combine(startupPath, fileName);
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace v2rayUpgrade
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
if (args.Length <= 0)
{
MessageBox.Show("Please use v2rayN to upgrade(请用v2rayN升级)");
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm(args));
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("v2rayUpgrade")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("v2rayUpgrade")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("f82be52a-155c-492c-9e0a-1e917ec62c78")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+71
View File
@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace v2rayUpgrade.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("v2rayUpgrade.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性
/// 使用此强类型的资源类的资源查找。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+30
View File
@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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>
//------------------------------------------------------------------------------
namespace v2rayUpgrade.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
+85
View File
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F82BE52A-155C-492C-9E0A-1E917EC62C78}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>v2rayUpgrade</RootNamespace>
<AssemblyName>v2rayUpgrade</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>D:\Github\v2rayN\v2rayN\v2rayUpgrade\bin\Debug\v2ray-windows.zip</StartArguments>
</PropertyGroup>
</Project>