Compare commits

..

50 Commits

Author SHA1 Message Date
2dust a2cf1cef16 fix ui 2019-09-11 09:42:58 +08:00
2dust 01fdb08dd3 up tls 2019-09-11 09:23:33 +08:00
2dust a8f1a992c5 Update MainForm.cs 2019-09-02 11:08:19 +08:00
2dust 1bbc73f963 Update ListViewFlickerFree.cs 2019-09-02 11:08:15 +08:00
2dust 2676ce0357 up 2019-09-01 20:14:02 +08:00
2dust b22bb90d2d fix state 2019-08-30 16:24:43 +08:00
2dust d0ca8b2996 up grpc state 2019-08-30 10:22:28 +08:00
2dust 3154df1bde Update StatisticsHandler.cs 2019-08-29 17:30:44 +08:00
2dust 3cdff624ba Merge pull request #46 from CGQAQ/dev
try 放在循环内,有异常不会退出循环。捕获漏网之鱼(syste.memory.dll)
2019-08-28 13:14:06 +08:00
CGQAQ 3cd80a20bb try 放在循环内,有异常不会退出循环。有个漏网之鱼(syste.memory.dll) 2019-08-28 09:43:29 +08:00
2dust 8986a96100 Merge pull request #45 from CGQAQ/dev
只能先这样了
2019-08-28 08:05:49 +08:00
CGQAQ 612ad30660 2019-08-27 18:40:15 +08:00
CGQAQ bc6517626e 只能先这样了
grpc_csharp_ext.x86.dll 和 grpc_csharp_ext.x64dll 没办法引用,所有只能放到output目录里了
2019-08-27 18:29:41 +08:00
2dust 99e9425942 Merge pull request #44 from CGQAQ/dev
统计切换为grpc
2019-08-27 15:58:21 +08:00
CGQAQ d555081820 统计切换为grpc 2019-08-27 15:51:15 +08:00
2dust a3f42e1e25 Merge pull request #43 from CGQAQ/dev
去重加入host
2019-08-27 13:06:58 +08:00
CGQAQ 52b31fba1e delete useless code due to remove auto reboot 2019-08-27 12:17:58 +08:00
CGQAQ 328c0be6e9 Update Utils.cs 2019-08-27 12:16:18 +08:00
CGQAQ 65d2db55f8 Merge remote-tracking branch 'upstream/master' into dev 2019-08-27 12:10:28 +08:00
2dust 54bebd9a6b up speed 2019-08-27 09:02:20 +08:00
2dust dcd050eee1 Update v2rayN.csproj 2019-08-26 17:32:17 +08:00
2dust 7d5dcc307e up 2019-08-26 17:31:19 +08:00
CGQAQ 7459ada9c0 去重加入host
现在判定两个server是不是一样的要看address port path 和 host
2019-08-26 17:20:49 +08:00
2dust f9c3003cc9 Merge pull request #40 from CGQAQ/master
一些修改
2019-08-26 16:26:09 +08:00
CGQAQ c1354600c7 一些修改
1. 需要重启的设置保存会自动重启
2. 去重逻辑更新 address port path
3. 一些重构和小修改
2019-08-26 16:21:08 +08:00
2dust 86b45d18af Merge pull request #39 from CGQAQ/master
修复v2rayN有几率无法退出问题
2019-08-26 13:41:38 +08:00
CGQAQ 26c9cd4d27 Update StatisticsHandler.cs
如果调用kill的时候进程已经退出,就会导致v2rayN程序无法退出,先判断该进程是否已经退出再kill,修复该问题
2019-08-26 13:37:52 +08:00
2dust 1be22a1a2c Merge pull request #36 from CGQAQ/master
【新功能】实时网速显示和历史流量统计,测速快捷键
2019-08-26 13:06:41 +08:00
CGQAQ 83e7ad9360 fix infinite loop thread hang there causes v2rayN hang in the background
修复死循环线程导致v2rayN在用户点击退出仍挂在后台
2019-08-26 09:32:45 +08:00
CGQAQ fe015b0227 fix number may exceed 1024
修复网速可能超过1024的问题,比如1500 Byte 应该是 1.x KB
2019-08-25 23:30:00 +08:00
CGQAQ 2861bff5a0 Add one click deduplicate feature
添加一键删除重复服务器功能
2019-08-25 22:43:28 +08:00
CGQAQ f036f12925 Update Utils.cs 2019-08-25 10:07:51 +08:00
CGQAQ 56bb63a012 add Statistics(netspeed, traffic data amount) 2019-08-25 09:33:38 +08:00
CGQAQ f1e9737080 basically completed 2019-08-24 21:32:33 +08:00
CGQAQ 649f0af6ec add Hotkeys
添加测速快捷键
2019-08-23 18:07:25 +08:00
CGQAQ 025a4491ed Add ping and speedtest hotkeys
增加测速快捷键
2019-08-23 15:51:37 +08:00
CGQAQ 197d8f1ace Merge pull request #1 from 2dust/master
sync
2019-08-23 14:08:18 +08:00
2dust f51e651410 Update V2rayConfigHandler.cs 2019-08-23 13:27:05 +08:00
2dust a091616790 up trimex 2019-08-23 11:01:22 +08:00
2dust 150fa91ff3 Merge pull request #31 from CGQAQ/master
fix potential problems about not doing null checking
2019-08-23 10:14:43 +08:00
CGQAQ 33a25d8b49 fix potential problems about not doing null checking 2019-08-23 10:07:20 +08:00
2dust dd1a01556f up pac server 2019-08-21 16:35:01 +08:00
2dust 5a1e5707b8 unsetproxy 2019-08-21 16:34:46 +08:00
2dust 5ec275a7e0 add socks user 2019-08-21 16:34:22 +08:00
2dust d1644bb591 up ser 2019-08-20 13:15:31 +08:00
2dust 93ecd20719 Create issue_template.md 2019-08-13 17:14:55 +08:00
2dust ed0231e7f9 up 2019-08-01 10:21:20 +08:00
2dust cf6c20b12e up all 2019-07-30 11:53:58 +08:00
2dust ab37076adc up 2019-07-30 11:52:43 +08:00
2dust 7894dd93b4 Initial commit 2019-07-30 11:47:24 +08:00
30 changed files with 564 additions and 948 deletions
-1
View File
@@ -35,6 +35,5 @@ namespace v2rayN.Forms
Utils.SaveLog($"Loading custom icon failed: {e.Message}");
}
}
}
}
+14 -24
View File
@@ -52,16 +52,14 @@
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();
this.menuExport2ServerConfig = new System.Windows.Forms.ToolStripMenuItem();
this.menuExport2ShareUrl = new System.Windows.Forms.ToolStripMenuItem();
this.menuExport2SubContent = new System.Windows.Forms.ToolStripMenuItem();
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton();
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();
@@ -76,6 +74,7 @@
this.menuCopyPACUrl = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.menuExit = new System.Windows.Forms.ToolStripMenuItem();
this.bgwPing = new System.ComponentModel.BackgroundWorker();
this.bgwScan = new System.ComponentModel.BackgroundWorker();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
@@ -185,8 +184,6 @@
this.menuSelectAll,
this.toolStripSeparator9,
this.menuPingServer,
this.menuTcpingServer,
this.menuRealPingServer,
this.menuSpeedServer,
this.toolStripSeparator6,
this.menuExport2ClientConfig,
@@ -308,18 +305,6 @@
resources.ApplyResources(this.menuPingServer, "menuPingServer");
this.menuPingServer.Click += new System.EventHandler(this.menuPingServer_Click);
//
// menuTcpingServer
//
this.menuTcpingServer.Name = "menuTcpingServer";
resources.ApplyResources(this.menuTcpingServer, "menuTcpingServer");
this.menuTcpingServer.Click += new System.EventHandler(this.menuTcpingServer_Click);
//
// menuRealPingServer
//
this.menuRealPingServer.Name = "menuRealPingServer";
resources.ApplyResources(this.menuRealPingServer, "menuRealPingServer");
this.menuRealPingServer.Click += new System.EventHandler(this.menuRealPingServer_Click);
//
// menuSpeedServer
//
this.menuSpeedServer.Name = "menuSpeedServer";
@@ -355,11 +340,6 @@
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click);
//
// qrCodeControl
//
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
this.qrCodeControl.Name = "qrCodeControl";
//
// tsbServer
//
this.tsbServer.DropDown = this.cmsLv;
@@ -367,6 +347,11 @@
resources.ApplyResources(this.tsbServer, "tsbServer");
this.tsbServer.Name = "tsbServer";
//
// qrCodeControl
//
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
this.qrCodeControl.Name = "qrCodeControl";
//
// notifyMain
//
this.notifyMain.ContextMenuStrip = this.cmsMain;
@@ -465,6 +450,12 @@
resources.ApplyResources(this.menuExit, "menuExit");
this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
//
// bgwPing
//
this.bgwPing.WorkerReportsProgress = true;
this.bgwPing.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgwPing_DoWork);
this.bgwPing.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgwPing_ProgressChanged);
//
// bgwScan
//
this.bgwScan.WorkerReportsProgress = true;
@@ -791,6 +782,7 @@
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;
@@ -866,8 +858,6 @@
private System.Windows.Forms.ToolStripStatusLabel toolSslServerSpeed;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank4;
private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer;
private System.Windows.Forms.ToolStripMenuItem menuTcpingServer;
private System.Windows.Forms.ToolStripMenuItem menuRealPingServer;
}
}
+165 -149
View File
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Text;
@@ -16,6 +15,7 @@ namespace v2rayN.Forms
private V2rayHandler v2rayHandler;
private PACListHandle pacListHandle;
private V2rayUpdateHandle v2rayUpdateHandle;
private V2rayUpdateHandle v2rayUpdateHandle2;
private List<int> lvSelecteds = new List<int>();
private StatisticsHandler statistics = null;
@@ -41,13 +41,64 @@ namespace v2rayN.Forms
ConfigHandler.LoadConfig(ref config);
v2rayHandler = new V2rayHandler();
v2rayHandler.ProcessEvent += v2rayHandler_ProcessEvent;
if (config.enableStatistics)
{
statistics = new StatisticsHandler(config, UpdateStatisticsHandler);
}
}
private void UpdateStatisticsHandler(ulong totalUp, ulong totalDown, ulong up, ulong down, List<Mode.ServerStatistics> statistics)
{
try
{
up /= (ulong)(config.statisticsFreshRate / 1000f);
down /= (ulong)(config.statisticsFreshRate / 1000f);
toolSslServerSpeed.Text = string.Format(
"{0}/s↑ | {1}/s↓",
Utils.HumanFy(up),
Utils.HumanFy(down)
);
List<string[]> datas = new List<string[]>();
for (int i = 0; i < config.vmess.Count; i++)
{
string totalUp_ = string.Empty,
totalDown_ = string.Empty,
todayUp_ = string.Empty,
todayDown_ = string.Empty;
var index = statistics.FindIndex(item_ => Utils.IsIdenticalServer(item_, new ServerStatistics(config.vmess[i].remarks, config.vmess[i].address, config.vmess[i].port, config.vmess[i].path, config.vmess[i].requestHost, 0, 0, 0, 0)));
if (index != -1)
{
totalUp_ = Utils.HumanFy(statistics[index].totalUp);
totalDown_ = Utils.HumanFy(statistics[index].totalDown);
todayUp_ = Utils.HumanFy(statistics[index].todayUp);
todayDown_ = Utils.HumanFy(statistics[index].todayDown);
}
datas.Add(new string[] { totalUp_, totalDown_, todayUp_, todayDown_ });
}
lvServers.Invoke((MethodInvoker)delegate
{
lvServers.SuspendLayout();
for (int i = 0; i < datas.Count; i++)
{
var indexStart = 9;
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][0];
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][1];
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][2];
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][3];
}
lvServers.ResumeLayout();
});
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private void MainForm_VisibleChanged(object sender, EventArgs e)
{
if (statistics == null || !statistics.Enable) return;
@@ -319,29 +370,21 @@ namespace v2rayN.Forms
private void DisplayToolStatus()
{
var localIP = "127.0.0.1";
toolSslSocksPort.Text =
toolSslHttpPort.Text =
toolSslPacPort.Text = "NONE";
toolSslSocksPort.Text = $"{Global.Loopback}:{config.inbound[0].localPort}";
toolSslSocksPort.Text = $"{localIP}:{config.inbound[0].localPort}";
if (config.sysAgentEnabled)
{
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.sysAgentPort}";
toolSslHttpPort.Text = $"{localIP}:{Global.sysAgentPort}";
if (config.listenerType == 2 || config.listenerType == 4)
{
if (PACServerHandle.IsRunning)
{
toolSslPacPort.Text = $"{HttpProxyHandle.GetPacUrl()}";
}
else
{
toolSslPacPort.Text = UIRes.I18N("StartPacFailed");
}
toolSslPacPort.Text = $"{HttpProxyHandle.GetPacUrl()}";
}
}
notifyMain.Icon = GetNotifyIcon();
}
private void ssMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
@@ -350,46 +393,6 @@ namespace v2rayN.Forms
Utils.SetClipboardData(e.ClickedItem.Text);
}
}
private Icon GetNotifyIcon()
{
try
{
var color = ColorTranslator.FromHtml("#3399CC");
var index = config.sysAgentEnabled ? config.listenerType : 0;
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);
bitmap.Save(Utils.GetPath("temp_icon.ico"), System.Drawing.Imaging.ImageFormat.Icon);
Icon createdIcon = Icon.FromHandle(bitmap.GetHicon());
drawBrush.Dispose();
graphics.Dispose();
bitmap.Dispose();
return createdIcon;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return this.Icon;
}
}
#endregion
#region v2ray
@@ -405,7 +408,6 @@ namespace v2rayN.Forms
}
v2rayHandler.LoadV2ray(config);
Global.reloadV2ray = false;
ConfigHandler.ToJsonFile(config);
ChangeSysAgent(config.sysAgentEnabled);
DisplayToolStatus();
@@ -488,18 +490,12 @@ namespace v2rayN.Forms
case Keys.A:
menuSelectAll_Click(null, null);
break;
case Keys.P:
menuPingServer_Click(null, null);
break;
case Keys.O:
menuTcpingServer_Click(null, null);
break;
case Keys.R:
menuRealPingServer_Click(null, null);
break;
case Keys.T:
menuSpeedServer_Click(null, null);
break;
case Keys.P:
menuPingServer_Click(null, null);
break;
}
}
switch (e.KeyCode)
@@ -564,6 +560,9 @@ namespace v2rayN.Forms
//刷新
RefreshServers();
LoadV2ray();
// save to config file
ConfigHandler.ToJsonFile(config);
}
private void menuCopyServer_Click(object sender, EventArgs e)
@@ -595,33 +594,12 @@ namespace v2rayN.Forms
{
GetLvSelectedIndex();
ClearTestResult();
var statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, "ping", UpdateSpeedtestHandler);
}
private void menuTcpingServer_Click(object sender, EventArgs e)
{
GetLvSelectedIndex();
ClearTestResult();
var statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, "tcping", UpdateSpeedtestHandler);
}
private void menuRealPingServer_Click(object sender, EventArgs e)
{
if (!config.sysAgentEnabled)
{
UI.Show(UIRes.I18N("NeedHttpGlobalProxy"));
return;
}
UI.Show(UIRes.I18N("SpeedServerTips"));
GetLvSelectedIndex();
ClearTestResult();
var statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, "realping", UpdateSpeedtestHandler);
bgwPing.RunWorkerAsync();
}
private void menuSpeedServer_Click(object sender, EventArgs e)
{
if (!config.sysAgentEnabled)
if (!config.sysAgentEnabled || config.listenerType != 1)
{
UI.Show(UIRes.I18N("NeedHttpGlobalProxy"));
return;
@@ -630,7 +608,7 @@ namespace v2rayN.Forms
UI.Show(UIRes.I18N("SpeedServerTips"));
GetLvSelectedIndex();
var statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, "speedtest", UpdateSpeedtestHandler);
ServerSpeedTest();
}
private void menuExport2ClientConfig_Click(object sender, EventArgs e)
@@ -1034,7 +1012,7 @@ namespace v2rayN.Forms
{
//this.WindowState = FormWindowState.Minimized;
this.Hide();
//this.notifyMain.Icon = this.Icon;
this.notifyMain.Icon = this.Icon;
this.notifyMain.Visible = true;
this.ShowInTaskbar = false;
@@ -1044,7 +1022,40 @@ namespace v2rayN.Forms
#endregion
#region
private void bgwPing_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
try
{
for (int k = 0; k < lvSelecteds.Count; k++)
{
int index = lvSelecteds[k];
if (config.vmess[index].configType == (int)EConfigType.Custom)
{
continue;
}
long time = Utils.Ping(config.vmess[index].address);
bgwPing.ReportProgress(index, string.Format("{0}ms", time));
}
}
catch
{
}
}
private void bgwPing_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
{
try
{
int k = e.ProgressPercentage;
string time = string.Format("{0}", Convert.ToString(e.UserState));
SetTestResult(k, time);
}
catch
{
}
}
private void SetTestResult(int k, string txt)
{
config.vmess[k].testResult = txt;
@@ -1057,70 +1068,77 @@ namespace v2rayN.Forms
SetTestResult(k, "");
}
}
private void UpdateSpeedtestHandler(int index, string msg)
private int testCounter = 0;
private int ServerSpeedTestSub(int index, string url)
{
lvServers.Invoke((MethodInvoker)delegate
if (index >= lvSelecteds.Count)
{
lvServers.SuspendLayout();
SetTestResult(index, msg);
lvServers.ResumeLayout();
});
}
private void UpdateStatisticsHandler(ulong totalUp, ulong totalDown, ulong up, ulong down, List<Mode.ServerStatistics> statistics)
{
try
{
up /= (ulong)(config.statisticsFreshRate / 1000f);
down /= (ulong)(config.statisticsFreshRate / 1000f);
toolSslServerSpeed.Text = string.Format(
"{0}/s↑ | {1}/s↓",
Utils.HumanFy(up),
Utils.HumanFy(down)
);
List<string[]> datas = new List<string[]>();
for (int i = 0; i < config.vmess.Count; i++)
{
string totalUp_ = string.Empty,
totalDown_ = string.Empty,
todayUp_ = string.Empty,
todayDown_ = string.Empty;
var index = statistics.FindIndex(item_ => Utils.IsIdenticalServer(item_, new ServerStatistics(config.vmess[i].remarks, config.vmess[i].address, config.vmess[i].port, config.vmess[i].path, config.vmess[i].requestHost, 0, 0, 0, 0)));
if (index != -1)
{
totalUp_ = Utils.HumanFy(statistics[index].totalUp);
totalDown_ = Utils.HumanFy(statistics[index].totalDown);
todayUp_ = Utils.HumanFy(statistics[index].todayUp);
todayDown_ = Utils.HumanFy(statistics[index].todayDown);
}
datas.Add(new string[] { totalUp_, totalDown_, todayUp_, todayDown_ });
}
lvServers.Invoke((MethodInvoker)delegate
{
lvServers.SuspendLayout();
for (int i = 0; i < datas.Count; i++)
{
var indexStart = 9;
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][0];
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][1];
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][2];
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][3];
}
lvServers.ResumeLayout();
});
return -1;
}
catch (Exception ex)
if (ConfigHandler.SetDefaultServer(ref config, lvSelecteds[index]) == 0)
{
Utils.SaveLog(ex.Message, ex);
SetTestResult(lvSelecteds[index], "testing...");
v2rayHandler.LoadV2ray(config);
v2rayUpdateHandle2.DownloadFileAsync(config, url);
testCounter++;
return 0;
}
else
{
return -1;
}
}
private void ServerSpeedTest()
{
if (config.vmess.Count <= 0)
{
return;
}
ClearTestResult();
string url = Global.SpeedTestUrl;
testCounter = 0;
if (v2rayUpdateHandle2 == null)
{
v2rayUpdateHandle2 = new V2rayUpdateHandle();
v2rayUpdateHandle2.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
AppendText(false, args.Msg);
SetTestResult(lvSelecteds[testCounter - 1], args.Msg);
if (ServerSpeedTestSub(testCounter, url) != 0)
{
RefreshServers();
return;
}
}
else
{
AppendText(false, args.Msg);
}
};
v2rayUpdateHandle2.Error += (sender2, args) =>
{
SetTestResult(lvSelecteds[testCounter - 1], args.GetException().Message);
AppendText(true, args.GetException().Message);
if (ServerSpeedTestSub(testCounter, url) != 0)
{
RefreshServers();
return;
}
};
}
if (ServerSpeedTestSub(testCounter, url) != 0)
{
return;
}
}
#endregion
#region
@@ -1535,7 +1553,5 @@ namespace v2rayN.Forms
#endregion
}
}
+15 -30
View File
@@ -231,19 +231,7 @@
<value>447, 22</value>
</data>
<data name="menuPingServer.Text" xml:space="preserve">
<value>Test server ping (multiple choice)(Ctrl+P)</value>
</data>
<data name="menuTcpingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>447, 22</value>
</data>
<data name="menuTcpingServer.Text" xml:space="preserve">
<value>Test server tcping (multiple choice)(Ctrl+O)</value>
</data>
<data name="menuRealPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>447, 22</value>
</data>
<data name="menuRealPingServer.Text" xml:space="preserve">
<value>Test server real ping (multiple choice)(Ctrl+R)</value>
<value>Test server delay (multiple choice)(Ctrl+P)</value>
</data>
<data name="menuSpeedServer.Size" type="System.Drawing.Size, System.Drawing">
<value>447, 22</value>
@@ -291,7 +279,7 @@
<value>ImageAboveText</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>448, 556</value>
<value>448, 490</value>
</data>
<data name="&gt;&gt;cmsLv.Name" xml:space="preserve">
<value>cmsLv</value>
@@ -506,6 +494,9 @@
<data name="notifyMain.Visible" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<metadata name="bgwPing.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>232, 17</value>
</metadata>
<metadata name="bgwScan.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>498, 17</value>
</metadata>
@@ -570,7 +561,7 @@
<value>0</value>
</data>
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>228, 18</value>
<value>603, 17</value>
</metadata>
<data name="toolSslSocksPortLab.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
@@ -588,7 +579,7 @@
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 17</value>
<value>188, 17</value>
</data>
<data name="toolSslHttpPortLab.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
@@ -606,7 +597,7 @@
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 17</value>
<value>188, 17</value>
</data>
<data name="toolSslPacPortLab.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 8pt</value>
@@ -624,7 +615,7 @@
<value>微软雅黑, 8pt</value>
</data>
<data name="toolSslBlank3.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 17</value>
<value>188, 17</value>
</data>
<data name="toolSslServerSpeed.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
@@ -1058,18 +1049,6 @@
<data name="&gt;&gt;menuPingServer.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuTcpingServer.Name" xml:space="preserve">
<value>menuTcpingServer</value>
</data>
<data name="&gt;&gt;menuTcpingServer.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuRealPingServer.Name" xml:space="preserve">
<value>menuRealPingServer</value>
</data>
<data name="&gt;&gt;menuRealPingServer.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuSpeedServer.Name" xml:space="preserve">
<value>menuSpeedServer</value>
</data>
@@ -1190,6 +1169,12 @@
<data name="&gt;&gt;menuExit.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;bgwPing.Name" xml:space="preserve">
<value>bgwPing</value>
</data>
<data name="&gt;&gt;bgwPing.Type" xml:space="preserve">
<value>System.ComponentModel.BackgroundWorker, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;bgwScan.Name" xml:space="preserve">
<value>bgwScan</value>
</data>
+54 -57
View File
@@ -119,157 +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>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuAddVmessServer.Text" xml:space="preserve">
<value>添加[VMess]服务器</value>
</data>
<data name="menuAddShadowsocksServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuAddShadowsocksServer.Text" xml:space="preserve">
<value>添加[Shadowsocks]服务器</value>
</data>
<data name="menuAddSocksServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuAddSocksServer.Text" xml:space="preserve">
<value>添加[Socks]服务器</value>
</data>
<data name="menuAddCustomServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuAddCustomServer.Text" xml:space="preserve">
<value>添加自定义配置服务器</value>
</data>
<data name="menuAddServers.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuAddServers.Text" xml:space="preserve">
<value>从剪贴板导入批量URL</value>
</data>
<data name="menuScanScreen.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuScanScreen.Text" xml:space="preserve">
<value>扫描屏幕上的二维码</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>249, 6</value>
</data>
<data name="menuRemoveServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuRemoveServer.Text" xml:space="preserve">
<value>移除所选服务器(多选) (Delete)</value>
</data>
<data name="menuRemoveDuplicateServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuRemoveDuplicateServer.Text" xml:space="preserve">
<value>移除重复的服务器</value>
</data>
<data name="menuCopyServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuCopyServer.Text" xml:space="preserve">
<value>复制所选服务器</value>
</data>
<data name="menuSetDefaultServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuSetDefaultServer.Text" xml:space="preserve">
<value>设为活动服务器 (Enter)</value>
</data>
<data name="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>249, 6</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuMoveTop.Text" xml:space="preserve">
<value>上移至顶</value>
</data>
<data name="menuMoveUp.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuMoveUp.Text" xml:space="preserve">
<value>上移 (U)</value>
</data>
<data name="menuMoveDown.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuMoveDown.Text" xml:space="preserve">
<value>下移 (D)</value>
</data>
<data name="menuMoveBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>下移至底</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
</data>
<data name="toolStripSeparator9.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>249, 6</value>
</data>
<data name="menuPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuPingServer.Text" xml:space="preserve">
<value>测试服务器延迟Ping(多选)(Ctrl+P)</value>
</data>
<data name="menuTcpingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
</data>
<data name="menuTcpingServer.Text" xml:space="preserve">
<value>测试服务器延迟Tcping(多选)(Ctrl+O)</value>
</data>
<data name="menuRealPingServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
</data>
<data name="menuRealPingServer.Text" xml:space="preserve">
<value>测试服务器真连接延迟(多选)(Ctrl+R)</value>
<value>测试服务器延迟(多选)(Ctrl+P)</value>
</data>
<data name="menuSpeedServer.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuSpeedServer.Text" xml:space="preserve">
<value>测试服务器速度(多选)(Ctrl+T)</value>
</data>
<data name="toolStripSeparator6.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 6</value>
<value>249, 6</value>
</data>
<data name="menuExport2ClientConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuExport2ClientConfig.Text" xml:space="preserve">
<value>导出所选服务器为客户端配置</value>
</data>
<data name="menuExport2ServerConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuExport2ServerConfig.Text" xml:space="preserve">
<value>导出所选服务器为服务端配置</value>
</data>
<data name="menuExport2ShareUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuExport2ShareUrl.Text" xml:space="preserve">
<value>批量导出分享URL至剪贴板(多选)</value>
</data>
<data name="menuExport2SubContent.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 22</value>
<value>252, 22</value>
</data>
<data name="menuExport2SubContent.Text" xml:space="preserve">
<value>批量导出订阅内容至剪贴板(多选)</value>
</data>
<data name="tsbServer.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 53</value>
</data>
<data name="tsbServer.Text" xml:space="preserve">
<value> 服务器 </value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>279, 534</value>
<value>253, 490</value>
</data>
<data name="lvServers.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
@@ -288,12 +282,6 @@
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="tsbServer.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 53</value>
</data>
<data name="tsbServer.Text" xml:space="preserve">
<value> 服务器 </value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 164</value>
</data>
@@ -372,8 +360,14 @@
<data name="groupBox2.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
<data name="toolSslBlank1.Size" type="System.Drawing.Size, System.Drawing">
<value>176, 17</value>
</data>
<data name="toolSslBlank2.Size" type="System.Drawing.Size, System.Drawing">
<value>176, 17</value>
</data>
<data name="toolSslBlank3.Size" type="System.Drawing.Size, System.Drawing">
<value>176, 17</value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
@@ -401,13 +395,13 @@
</data>
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3
NQwF4JkcFRWiUAB7IVW2FFPO3YqlgPd+LJf02e8Fdi3rMdIAcLDuf9UpeT0IS0G/hvhPm305vSl7EQFY
B6zCvozvYGzRM8zEoeg5TPZwDaGvpHQni1yzSxbXPW9q+hF13ROHuJnQcjbhtQAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAATdJREFUWEftloENAiEMRW8ER3AEN9ANdARHcAPdwBF0A91AN9INtC+5JvUCJwWM
mvCTFw3QUiiU65qa/lUTYT6Ato9rJZyERwT6GFNdU+EihCYNwVhsqmgm3AR1fheOAitd9PCfNvp0HDbY
FolV2MmZZCzX9J0FG0TRTlwFdbahIVE7Qe1IR5bYVnXCyr2yO5F1MNUBec25YtjomcCXSxhr9DmrV2Gr
flyL4GSrYcm9tmnEZ7JsAC7DgWr5ydbXA8hOAcVjG8FTD6ocQgvXKrW8MqFWUfc1DAXgmRwVFaJQAHsh
VbYUU87diqWA934sl/TZ7wV2Lesx0gBwsO5/1Sl5PQhLQb+G+E+bfTm9KXsRAVgHrMK+jO9gbNEzzMSh
6DlM9nANoa+kdCeLXLNLFtc9b2r6EXXdE4e4mdByNuG1AAAAAElFTkSuQmCC
</value>
</data>
<data name="tsbReload.Size" type="System.Drawing.Size, System.Drawing">
@@ -463,12 +457,15 @@
</data>
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAADJJREFUWEftzrENACAIRUFGdVMdTZkAG4zFXfI68kMAAD8ap9lUbpfyaDV19QAA
8FDEBl3RImu5VcdbAAAAAElFTkSuQmCC
</value>
</data>
<data name="tsbClose.Text" xml:space="preserve">
<value> 关闭 </value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
</root>
-4
View File
@@ -42,10 +42,6 @@ namespace v2rayN.Forms
cmbprotocol.Text = config.inbound[0].protocol.ToString();
chkudpEnabled.Checked = config.inbound[0].udpEnabled;
chksniffingEnabled.Checked = config.inbound[0].sniffingEnabled;
txtlocalPort2.Text = "socks + 1";
cmbprotocol2.Text = "http";
if (config.inbound.Count > 1)
{
txtlocalPort2.Text = config.inbound[1].localPort.ToString();
@@ -357,6 +357,9 @@
<data name="cmbprotocol2.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="cmbprotocol2.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;cmbprotocol2.Name" xml:space="preserve">
<value>cmbprotocol2</value>
</data>
@@ -384,6 +387,9 @@
<data name="label3.Text" xml:space="preserve">
<value>protocol</value>
</data>
<data name="label3.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
@@ -405,6 +411,9 @@
<data name="txtlocalPort2.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="txtlocalPort2.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;txtlocalPort2.Name" xml:space="preserve">
<value>txtlocalPort2</value>
</data>
+2 -3
View File
@@ -18,7 +18,6 @@ namespace v2rayN
/// SpeedTestUrl
/// </summary>
public const string SpeedTestUrl = @"http://speedtest-sfo2.digitalocean.com/10mb.test";
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
/// <summary>
/// CustomRoutingListUrl
@@ -147,10 +146,10 @@ namespace v2rayN
/// </summary>
public const string CustomIconName = "v2rayN.ico";
public const string Loopback = "127.0.0.1";
public const string InboundAPITagName = "api";
public const string InboundProxyTagName = "proxy";
public const string InboundProxyTagName = "proxy";
public const string Loopback = "127.0.0.1";
public const string InboundAPIProtocal = "dokodemo-door";
public enum StatisticsFreshRate
-306
View File
@@ -1,306 +0,0 @@
using Grpc.Core;
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 V2rayUpdateHandle v2rayUpdateHandle2;
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.Start();
}
if (actionType == "tcping")
{
_workThread = new Thread(new ThreadStart(RunTcping));
_workThread.Start();
}
else if (actionType == "realping")
{
_workThread = new Thread(new ThreadStart(RunRealPing));
_workThread.Start();
}
else if (actionType == "speedtest")
{
RunSpeedTest();
}
}
public void Close()
{
try
{
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
public 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(1);
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
public 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(1);
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
public void RunRealPing()
{
try
{
for (int k = 0; k < _selecteds.Count; k++)
{
int index = _selecteds[k];
if (_config.vmess[index].configType == (int)EConfigType.Custom)
{
continue;
}
try
{
if (ConfigHandler.SetDefaultServer(ref _config, index) == 0)
{
_v2rayHandler.LoadV2ray(_config);
}
else
{
return;
}
Thread.Sleep(1000 * 5);
int responseTime = -1;
var status = GetRealPingTime(Global.SpeedPingTestUrl, 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(1);
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private void RunSpeedTest()
{
if (_config.vmess.Count <= 0)
{
return;
}
string url = Global.SpeedTestUrl;
testCounter = 0;
if (v2rayUpdateHandle2 == null)
{
v2rayUpdateHandle2 = new V2rayUpdateHandle();
v2rayUpdateHandle2.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
_updateFunc(ItemIndex, args.Msg);
if (ServerSpeedTestSub(testCounter, url) != 0)
{
return;
}
}
else
{
_updateFunc(ItemIndex, args.Msg);
}
};
v2rayUpdateHandle2.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)
{
return -1;
}
if (ConfigHandler.SetDefaultServer(ref _config, _selecteds[index]) == 0)
{
_v2rayHandler.LoadV2ray(_config);
testCounter++;
v2rayUpdateHandle2.DownloadFileAsync(_config, url);
return 0;
}
else
{
return -1;
}
}
private int GetTcpingTime(string url, int port)
{
var responseTime = -1;
try
{
IPHostEntry ipHostInfo = System.Net.Dns.Resolve(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, out int responseTime)
{
string msg = string.Empty;
responseTime = -1;
try
{
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
myHttpWebRequest.Timeout = 5000;
myHttpWebRequest.Proxy = new WebProxy(Global.Loopback, Global.sysAgentPort);
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;
}
}
}
+30 -54
View File
@@ -23,42 +23,21 @@ namespace v2rayN.Handler
private bool enabled_;
public bool Enable
{
get
{
return enabled_;
}
set
{
enabled_ = value;
}
get { return enabled_; }
set { enabled_ = value; }
}
public bool UpdateUI;
public ulong TotalUp
{
get; private set;
}
public ulong TotalUp { get; private set; }
public ulong TotalDown
{
get; private set;
}
public ulong TotalDown { get; private set; }
public List<Mode.ServerStatistics> Statistic
{
get; set;
}
public List<Mode.ServerStatistics> Statistic { get; set; }
public ulong Up
{
get; private set;
}
public ulong Up { get; private set; }
public ulong Down
{
get; private set;
}
public ulong Down { get; private set; }
private string logPath_;
@@ -70,7 +49,7 @@ namespace v2rayN.Handler
enabled_ = config.enableStatistics;
UpdateUI = false;
updateFunc_ = update;
logPath_ = Utils.GetPath(Global.StatisticLogDirectory);
logPath_ = Utils.GetPath($"{Global.StatisticLogDirectory}\\");
Statistic = new List<Mode.ServerStatistics>();
exitFlag_ = false;
@@ -95,7 +74,7 @@ namespace v2rayN.Handler
{
Global.statePort = GetFreePort();
channel_ = new Channel($"{Global.Loopback}:{Global.statePort}", ChannelCredentials.Insecure);
channel_ = new Channel($"127.0.0.1:{Global.statePort}", ChannelCredentials.Insecure);
channel_.ConnectAsync();
client_ = new StatsService.StatsServiceClient(channel_);
}
@@ -234,7 +213,7 @@ namespace v2rayN.Handler
Utils.ToHumanReadable(TotalUp, out up_amount, out up_unit);
Utils.ToHumanReadable(TotalDown, out down_amount, out down_unit);
overallWriter.WriteLine($"LastUpdate {DateTime.Now.ToString("yyyy-MM-dd")} {DateTime.Now.ToLongTimeString()}");
overallWriter.WriteLine($"LastUpdate {DateTime.Now.ToLongDateString()} {DateTime.Now.ToLongTimeString()}");
overallWriter.WriteLine($"UP {string.Format("{0:f2}", up_amount)}{up_unit} {TotalUp}");
overallWriter.WriteLine($"DOWN {string.Format("{0:f2}", down_amount)}{down_unit} {TotalDown}");
foreach (var s in Statistic)
@@ -249,7 +228,7 @@ namespace v2rayN.Handler
}
// 当天流量记录文件
var dailyPath = Path.Combine(logPath_, $"{DateTime.Now.ToString("yyyy-MM-dd")}.txt");
var dailyPath = Path.Combine(logPath_, $"{DateTime.Now.ToLongDateString()}.txt");
if (!File.Exists(dailyPath))
{
File.Create(dailyPath);
@@ -258,7 +237,7 @@ namespace v2rayN.Handler
{
using (var dailyWriter = new StreamWriter(dailyPath))
{
dailyWriter.WriteLine($"LastUpdate {DateTime.Now.ToString("yyyy-MM-dd")} {DateTime.Now.ToLongTimeString()}");
dailyWriter.WriteLine($"LastUpdate {DateTime.Now.ToLongDateString()} {DateTime.Now.ToLongTimeString()}");
foreach (var s in Statistic)
{
dailyWriter.WriteLine($"* {s.name} {s.address} {s.port} {s.path} {s.host} {s.todayUp} {s.todayDown}");
@@ -282,12 +261,11 @@ namespace v2rayN.Handler
/// UP [readable string] [amount]
/// DOWN [readable string] [amount]
/// 每行每个数据空格分隔
try
///
var overallPath = Path.Combine(logPath_, Global.StatisticLogOverall);
if (File.Exists(overallPath))
{
Utils.SaveLog(logPath_ + Global.StatisticLogOverall);
var overallPath = Path.Combine(logPath_, Global.StatisticLogOverall);
if (File.Exists(overallPath))
try
{
using (var overallReader = new StreamReader(overallPath))
{
@@ -336,22 +314,20 @@ namespace v2rayN.Handler
}
}
}
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
try
{
Utils.SaveLog(logPath_ + $"{DateTime.Now.ToString("yyyy-MM-dd")}.txt");
var dailyPath = Path.Combine(logPath_, $"{DateTime.Now.ToString("yyyy-MM-dd")}.txt");
if (File.Exists(dailyPath))
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
// 当天流量记录文件
var dailyPath = Path.Combine(logPath_, $"{DateTime.Now.ToLongDateString()}.txt");
if (File.Exists(dailyPath))
{
try
{
using (var dailyReader = new StreamReader(dailyPath))
{
while (!dailyReader.EndOfStream)
@@ -389,10 +365,10 @@ namespace v2rayN.Handler
}
}
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
}
+1 -1
View File
@@ -159,7 +159,7 @@ namespace v2rayN.Handler
}
else
{
inbound.listen = Global.Loopback;
inbound.listen = "127.0.0.1";
}
//开启udp
inbound.settings.udp = config.inbound[0].udpEnabled;
+5 -14
View File
@@ -7,7 +7,6 @@ using Newtonsoft.Json;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.HttpProxyHandler;
using System.Diagnostics;
namespace v2rayN.Handler
{
@@ -24,10 +23,7 @@ namespace v2rayN.Handler
public string DownloadFileName
{
get
{
return "v2ray-windows.zip";
}
get { return "v2ray-windows.zip"; }
}
public class ResultEventArgs : EventArgs
@@ -49,16 +45,15 @@ namespace v2rayN.Handler
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(OnResponseV2rayCore), request);
request.BeginGetResponse(new AsyncCallback(OnResponse), request);
}
private void OnResponseV2rayCore(IAsyncResult ar)
private void OnResponse(IAsyncResult ar)
{
try
{
@@ -100,14 +95,12 @@ namespace v2rayN.Handler
ServicePointManager.DefaultConnectionLimit = 256;
if (UpdateCompleted != null)
{
UpdateCompleted(this, new ResultEventArgs(false, "Downloading..."));
UpdateCompleted(this, new ResultEventArgs(false, url));
}
progressPercentage = -1;
WebClientEx ws = new WebClientEx();
ws.Proxy = new WebProxy(Global.Loopback, Global.sysAgentPort);
ws.DownloadFileCompleted += ws_DownloadFileCompleted;
ws.DownloadProgressChanged += ws_DownloadProgressChanged;
ws.DownloadFileAsync(new Uri(url), Utils.GetPath(DownloadFileName));
@@ -135,7 +128,7 @@ namespace v2rayN.Handler
if (progressPercentage != e.ProgressPercentage && e.ProgressPercentage % 10 == 0)
{
progressPercentage = e.ProgressPercentage;
string msg = string.Format("...{0}%", e.ProgressPercentage);
string msg = string.Format("......{0}%", e.ProgressPercentage);
UpdateCompleted(this, new ResultEventArgs(false, msg));
}
}
@@ -217,7 +210,5 @@ namespace v2rayN.Handler
Error(this, new ErrorEventArgs(ex));
}
}
}
}
@@ -47,7 +47,7 @@ namespace v2rayN.HttpProxyHandler
{
PACServerHandle.Stop();
PACFileWatcherHandle.StopWatch();
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}", null);
SysProxyHandle.SetIEProxy(true, true, "127.0.0.1:" + port, null);
}
else if (type == 2)
{
@@ -168,8 +168,8 @@ namespace v2rayN.HttpProxyHandler
public static string GetPacUrl()
{
string pacUrl = $"http://{Global.Loopback}:{Global.pacPort}/pac/?t={GetTimestamp(DateTime.Now)}";
string pacUrl = string.Format("http://127.0.0.1:{0}/pac/?t={1}", Global.pacPort,
GetTimestamp(DateTime.Now));
return pacUrl;
}
@@ -8,9 +8,9 @@ namespace v2rayN.HttpProxyHandler
public class HttpWebServer
{
private HttpListener _listener;
private Func<string, string> _responderMethod;
private Func<HttpListenerRequest, string> _responderMethod;
public HttpWebServer(string[] prefixes, Func<string, string> method)
public HttpWebServer(string[] prefixes, Func<HttpListenerRequest, string> method)
{
try
{
@@ -39,11 +39,10 @@ namespace v2rayN.HttpProxyHandler
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
throw;
}
}
public HttpWebServer(Func<string, string> method, params string[] prefixes)
public HttpWebServer(Func<HttpListenerRequest, string> method, params string[] prefixes)
: this(prefixes, method) { }
public void Run()
@@ -60,8 +59,7 @@ namespace v2rayN.HttpProxyHandler
var ctx = c as HttpListenerContext;
try
{
string address = ctx.Request.LocalEndPoint.Address.ToString();
string rstr = _responderMethod(address);
string rstr = _responderMethod(ctx.Request);
byte[] buf = Encoding.UTF8.GetBytes(rstr);
ctx.Response.StatusCode = 200;
ctx.Response.ContentType = "application/x-ns-proxy-autoconfig";
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.IO;
using System.Net;
using System.Net.Sockets;
@@ -10,20 +9,84 @@ namespace v2rayN.HttpProxyHandler
{
public class HttpWebServerB
{
private TcpListener listener;
private int port;
private Func<string, string> _responderMethod;
private TcpListener listener;
public HttpWebServerB(int port, Func<string, string> method)
private Func<TcpClient, string> _responderMethod;
public HttpWebServerB(int port, Func<TcpClient, string> method)
{
this.port = port;
this._responderMethod = method;
try
{
this.port = port;
this._responderMethod = method;
Thread thread = new Thread(StartListen);
thread.IsBackground = true;
thread.Start();
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 (!Utils.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)
@@ -32,93 +95,38 @@ namespace v2rayN.HttpProxyHandler
listener = null;
}
}
private void StartListen()
//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)
{
listener = new TcpListener(IPAddress.Any, port);
listener.Start();
Utils.SaveLog("WebserverB running...");
StringBuilder sb = new StringBuilder();
string content_type = "application/x-ns-proxy-autoconfig";
while (true)
{
TcpClient socket = listener.AcceptTcpClient();
Thread thread = new Thread(new ParameterizedThreadStart(ProcessThread));
thread.Start(socket);
Thread.Sleep(1);
}
}
private void ProcessThread(object obj)
{
try
{
var socket = obj as TcpClient;
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();
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();
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);
}
return sb.ToString();
}
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();
}
}
}
@@ -46,7 +46,7 @@ namespace v2rayN.HttpProxyHandler
//{
// throw new Exception("未发现HTTP代理,无法设置代理更新");
//}
var http = new WebClientEx();
WebClient http = new WebClient();
//http.Headers.Add("Connection", "Close");
//http.Proxy = new WebProxy(IPAddress.Loopback.ToString(), httpProxy.localPort);
http.DownloadStringCompleted += http_DownloadStringCompleted;
@@ -75,7 +75,7 @@ namespace v2rayN.HttpProxyHandler
public static List<string> ParseResult(string response)
{
byte[] bytes = Convert.FromBase64String(response);
string content = Encoding.UTF8.GetString(bytes);
string content = Encoding.ASCII.GetString(bytes);
List<string> valid_lines = new List<string>();
using (var sr = new StringReader(content))
{
@@ -1,6 +1,8 @@
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;
@@ -17,36 +19,19 @@ namespace v2rayN.HttpProxyHandler
private static HttpWebServer server;
private static HttpWebServerB serverB;
public static bool IsRunning
{
get
{
return (pacPort > 0);
}
}
public static void Init(Config config)
{
//if (InitServer("*"))
//{
// pacPort = Global.pacPort;
//}
if (InitServer(Global.Loopback))
if (Utils.IsAdministrator())
{
pacPort = Global.pacPort;
}
else if (InitServerB(Global.Loopback))
{
pacPort = Global.pacPort;
InitServer("127.0.0.1");
}
else
{
Utils.SaveLog("Webserver init failed ");
pacPort = 0;
InitServerB("127.0.0.1");
}
}
private static bool InitServer(string address)
public static void InitServer(string address)
{
try
{
@@ -60,13 +45,13 @@ namespace v2rayN.HttpProxyHandler
if (server == null)
{
string prefixes = string.Format("http://{0}:{1}/pac/", address, Global.pacPort);
string prefixes = string.Format("http://{0}:{1}/pac/", "+", Global.pacPort);
Utils.SaveLog("Webserver prefixes " + prefixes);
server = new HttpWebServer(SendResponse, prefixes);
server.Run();
HttpWebServer ws = new HttpWebServer(SendResponse, prefixes);
ws.Run();
//pacPort = Global.pacPort;
pacPort = Global.pacPort;
}
}
Utils.SaveLog("Webserver at " + address);
@@ -74,12 +59,11 @@ namespace v2rayN.HttpProxyHandler
catch (Exception ex)
{
Utils.SaveLog("Webserver InitServer " + ex.Message);
return false;
}
return true;
}
public static bool InitServerB(string address)
public static void InitServerB(string address)
{
try
{
@@ -94,23 +78,22 @@ namespace v2rayN.HttpProxyHandler
if (serverB == null)
{
serverB = new HttpWebServerB(Global.pacPort, SendResponse);
//pacPort = Global.pacPort;
pacPort = Global.pacPort;
}
}
Utils.SaveLog("WebserverB at " + address);
Utils.SaveLog("Webserver at " + address);
}
catch (Exception ex)
{
Utils.SaveLog("WebserverB InitServer " + ex.Message);
return false;
Utils.SaveLog("Webserver InitServer " + ex.Message);
}
return true;
}
public static string SendResponse(string address)
public static string SendResponse(HttpListenerRequest request)
{
try
{
string address = request.LocalEndPoint.Address.ToString();
var pac = GetPacList(address);
return pac;
}
@@ -120,6 +103,27 @@ 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()
{
@@ -155,7 +159,6 @@ namespace v2rayN.HttpProxyHandler
//}
}
private static string GetPacList(string address)
{
var port = Global.sysAgentPort;
@@ -179,10 +182,8 @@ namespace v2rayN.HttpProxyHandler
return pac;
}
catch
{
}
{ }
return "No pac content";
}
}
}
@@ -99,7 +99,7 @@ namespace v2rayN.HttpProxyHandler
}
else
{
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", Global.Loopback);
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", "127.0.0.1");
}
FileManager.ByteArrayToFile(Utils.GetTempPath(_uniqueConfigFile), Encoding.UTF8.GetBytes(privoxyConfig));
@@ -49,14 +49,14 @@ namespace v2rayN.HttpProxyHandler
public static void SetIEProxy(bool enable, bool global, string proxyServer, string pacURL)
{
//Read();
Read();
//if (!_userSettings.UserSettingsRecorded)
//{
// // record user settings
// ExecSysproxy("query");
// ParseQueryStr(_queryStr);
//}
if (!_userSettings.UserSettingsRecorded)
{
// record user settings
ExecSysproxy("query");
ParseQueryStr(_queryStr);
}
string arguments;
if (enable)
@@ -71,19 +71,17 @@ namespace v2rayN.HttpProxyHandler
else
{
// restore user settings
//var flags = _userSettings.Flags;
//var proxy_server = _userSettings.ProxyServer ?? "-";
//var bypass_list = _userSettings.BypassList ?? "-";
//var pac_url = _userSettings.PacUrl ?? "-";
////arguments = string.Format("set {0} {1} {2} {3}", flags, proxy_server, bypass_list, pac_url);
//set null settings
arguments = string.Format("set {0} {1} {2} {3}", 1, "-", "<local>", @"http://127.0.0.1");
var flags = _userSettings.Flags;
var proxy_server = _userSettings.ProxyServer ?? "-";
var bypass_list = _userSettings.BypassList ?? "-";
var pac_url = _userSettings.PacUrl ?? "-";
arguments = string.Format("set {0} {1} {2} {3}", flags, proxy_server, bypass_list, pac_url);
// have to get new settings
//_userSettings.UserSettingsRecorded = false;
_userSettings.UserSettingsRecorded = false;
}
//Save();
Save();
ExecSysproxy(arguments);
}
+3 -28
View File
@@ -5,42 +5,17 @@ namespace v2rayN.HttpProxyHandler
{
class WebClientEx : WebClient
{
public int Timeout
{
get; set;
}
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);
}
var request = 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 -1
View File
@@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
// 方法是按如下所示使用“*”:
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("2.45")]
[assembly: AssemblyFileVersion("2.39")]
+1 -11
View File
@@ -19,7 +19,7 @@ namespace v2rayN.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.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 Resources {
@@ -120,16 +120,6 @@ 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>
-3
View File
@@ -136,9 +136,6 @@
<data name="minimize" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notify" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\notify.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="option" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\option.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.
-1
View File
@@ -4,5 +4,4 @@ logfile v2ray_privoxy.log
show-on-task-bar 0
activity-animation 0
forward-socks5 / 127.0.0.1:__SOCKS_PORT__ .
max-client-connections 2048
hide-console
+98 -98
View File
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@@ -13,13 +13,13 @@ namespace v2rayN.Resx {
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class ResUI {
@@ -33,7 +33,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
@@ -47,8 +47,8 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
@@ -61,7 +61,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Batch export subscription to clipboard successfully 的本地化字符串。
/// Looks up a localized string similar to Batch export subscription to clipboard successfully.
/// </summary>
internal static string BatchExportSubscriptionSuccessfully {
get {
@@ -70,7 +70,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Batch export share URL to clipboard successfully 的本地化字符串。
/// Looks up a localized string similar to Batch export share URL to clipboard successfully.
/// </summary>
internal static string BatchExportURLSuccessfully {
get {
@@ -79,7 +79,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please check the server settings first 的本地化字符串。
/// Looks up a localized string similar to Please check the server settings first.
/// </summary>
internal static string CheckServerSettings {
get {
@@ -88,7 +88,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 configuration format is incorrect 的本地化字符串。
/// Looks up a localized string similar to configuration format is incorrect.
/// </summary>
internal static string ConfigurationFormatIncorrect {
get {
@@ -97,7 +97,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Note that custom configuration relies entirely on your own configuration and does not work with all settings. The system agent is available when the socks port is equal to the port in the settings in the custom configuration inbound. 的本地化字符串。
/// Looks up a localized string similar to Note that custom configuration relies entirely on your own configuration and does not work with all settings. The system agent is available when the socks port is equal to the port in the settings in the custom configuration inbound..
/// </summary>
internal static string CustomServerTips {
get {
@@ -106,7 +106,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 DOWN 的本地化字符串。
/// Looks up a localized string similar to DOWN.
/// </summary>
internal static string downloadSpeed {
get {
@@ -115,7 +115,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Whether to download? {0} 的本地化字符串。
/// Looks up a localized string similar to Whether to download? {0}.
/// </summary>
internal static string DownloadYesNo {
get {
@@ -124,7 +124,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to convert configuration file 的本地化字符串。
/// Looks up a localized string similar to Failed to convert configuration file.
/// </summary>
internal static string FailedConversionConfiguration {
get {
@@ -133,7 +133,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to generate default configuration file 的本地化字符串。
/// Looks up a localized string similar to Failed to generate default configuration file.
/// </summary>
internal static string FailedGenDefaultConfiguration {
get {
@@ -142,7 +142,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to get the default configuration 的本地化字符串。
/// Looks up a localized string similar to Failed to get the default configuration.
/// </summary>
internal static string FailedGetDefaultConfiguration {
get {
@@ -151,7 +151,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to import custom configuration server 的本地化字符串。
/// Looks up a localized string similar to Failed to import custom configuration server.
/// </summary>
internal static string FailedImportedCustomServer {
get {
@@ -160,7 +160,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to read configuration file 的本地化字符串。
/// Looks up a localized string similar to Failed to read configuration file.
/// </summary>
internal static string FailedReadConfiguration {
get {
@@ -169,7 +169,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the correct format extra ID 的本地化字符串。
/// Looks up a localized string similar to Please fill in the correct format extra ID.
/// </summary>
internal static string FillCorrectAlterId {
get {
@@ -178,7 +178,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the correct format server port 的本地化字符串。
/// Looks up a localized string similar to Please fill in the correct format server port.
/// </summary>
internal static string FillCorrectServerPort {
get {
@@ -187,7 +187,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the KCP parameters correctly 的本地化字符串。
/// Looks up a localized string similar to Please fill in the KCP parameters correctly.
/// </summary>
internal static string FillKcpParameters {
get {
@@ -196,7 +196,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the local listening port 的本地化字符串。
/// Looks up a localized string similar to Please fill in the local listening port.
/// </summary>
internal static string FillLocalListeningPort {
get {
@@ -205,7 +205,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the password 的本地化字符串。
/// Looks up a localized string similar to Please fill in the password.
/// </summary>
internal static string FillPassword {
get {
@@ -214,7 +214,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the server address 的本地化字符串。
/// Looks up a localized string similar to Please fill in the server address.
/// </summary>
internal static string FillServerAddress {
get {
@@ -223,7 +223,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please fill in the user ID 的本地化字符串。
/// Looks up a localized string similar to Please fill in the user ID.
/// </summary>
internal static string FillUUID {
get {
@@ -232,7 +232,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 is not the correct client configuration file, please check 的本地化字符串。
/// Looks up a localized string similar to is not the correct client configuration file, please check.
/// </summary>
internal static string IncorrectClientConfiguration {
get {
@@ -241,7 +241,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 is not the correct configuration, please check 的本地化字符串。
/// Looks up a localized string similar to is not the correct configuration, please check.
/// </summary>
internal static string Incorrectconfiguration {
get {
@@ -250,7 +250,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 is not the correct server configuration file, please check 的本地化字符串。
/// Looks up a localized string similar to is not the correct server configuration file, please check.
/// </summary>
internal static string IncorrectServerConfiguration {
get {
@@ -259,7 +259,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Initial Configuration 的本地化字符串。
/// Looks up a localized string similar to Initial Configuration.
/// </summary>
internal static string InitialConfiguration {
get {
@@ -268,7 +268,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Address 的本地化字符串。
/// Looks up a localized string similar to Address.
/// </summary>
internal static string LvAddress {
get {
@@ -277,7 +277,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Alias 的本地化字符串。
/// Looks up a localized string similar to Alias.
/// </summary>
internal static string LvAlias {
get {
@@ -286,7 +286,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Security 的本地化字符串。
/// Looks up a localized string similar to Security.
/// </summary>
internal static string LvEncryptionMethod {
get {
@@ -295,7 +295,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Port 的本地化字符串。
/// Looks up a localized string similar to Port.
/// </summary>
internal static string LvPort {
get {
@@ -304,7 +304,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Type 的本地化字符串。
/// Looks up a localized string similar to Type.
/// </summary>
internal static string LvServiceType {
get {
@@ -313,7 +313,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Subs 的本地化字符串。
/// Looks up a localized string similar to Subs.
/// </summary>
internal static string LvSubscription {
get {
@@ -322,7 +322,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Test Results 的本地化字符串。
/// Looks up a localized string similar to Test Results.
/// </summary>
internal static string LvTestResults {
get {
@@ -331,7 +331,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Today download traffic 的本地化字符串。
/// Looks up a localized string similar to Today download traffic.
/// </summary>
internal static string LvTodayDownloadDataAmount {
get {
@@ -340,7 +340,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Today upload traffic 的本地化字符串。
/// Looks up a localized string similar to Today upload traffic.
/// </summary>
internal static string LvTodayUploadDataAmount {
get {
@@ -349,7 +349,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Total download traffic 的本地化字符串。
/// Looks up a localized string similar to Total download traffic.
/// </summary>
internal static string LvTotalDownloadDataAmount {
get {
@@ -358,7 +358,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Total upload traffic 的本地化字符串。
/// Looks up a localized string similar to Total upload traffic.
/// </summary>
internal static string LvTotalUploadDataAmount {
get {
@@ -367,7 +367,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Transport 的本地化字符串。
/// Looks up a localized string similar to Transport.
/// </summary>
internal static string LvTransportProtocol {
get {
@@ -376,7 +376,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 MediumFresh 的本地化字符串。
/// Looks up a localized string similar to MediumFresh.
/// </summary>
internal static string MediumFresh {
get {
@@ -385,7 +385,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Clear original subscription content 的本地化字符串。
/// Looks up a localized string similar to Clear original subscription content.
/// </summary>
internal static string MsgClearSubscription {
get {
@@ -394,7 +394,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Download V2rayCore successfully 的本地化字符串。
/// Looks up a localized string similar to Download V2rayCore successfully.
/// </summary>
internal static string MsgDownloadV2rayCoreSuccessfully {
get {
@@ -403,7 +403,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Failed to import subscription content 的本地化字符串。
/// Looks up a localized string similar to Failed to import subscription content.
/// </summary>
internal static string MsgFailedImportSubscription {
get {
@@ -412,7 +412,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Get the subscription content successfully 的本地化字符串。
/// Looks up a localized string similar to Get the subscription content successfully.
/// </summary>
internal static string MsgGetSubscriptionSuccessfully {
get {
@@ -421,7 +421,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 No valid subscriptions set 的本地化字符串。
/// Looks up a localized string similar to No valid subscriptions set.
/// </summary>
internal static string MsgNoValidSubscription {
get {
@@ -430,7 +430,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 PAC update failed 的本地化字符串。
/// Looks up a localized string similar to PAC update failed.
/// </summary>
internal static string MsgPACUpdateFailed {
get {
@@ -439,7 +439,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 PAC update succeeded 的本地化字符串。
/// Looks up a localized string similar to PAC update succeeded.
/// </summary>
internal static string MsgPACUpdateSuccessfully {
get {
@@ -448,7 +448,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Resolve V2rayCore successfully 的本地化字符串。
/// Looks up a localized string similar to Resolve V2rayCore successfully.
/// </summary>
internal static string MsgParsingV2rayCoreSuccessfully {
get {
@@ -457,7 +457,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Simplify PAC Success 的本地化字符串。
/// Looks up a localized string similar to Simplify PAC Success.
/// </summary>
internal static string MsgSimplifyPAC {
get {
@@ -466,7 +466,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Start getting subscriptions 的本地化字符串。
/// Looks up a localized string similar to Start getting subscriptions.
/// </summary>
internal static string MsgStartGettingSubscriptions {
get {
@@ -475,7 +475,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Start updating PAC... 的本地化字符串。
/// Looks up a localized string similar to Start updating PAC....
/// </summary>
internal static string MsgStartUpdatingPAC {
get {
@@ -484,7 +484,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Start updating V2rayCore... 的本地化字符串。
/// Looks up a localized string similar to Start updating V2rayCore....
/// </summary>
internal static string MsgStartUpdatingV2rayCore {
get {
@@ -493,7 +493,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Subscription content decoding failed (non-BASE64 code) 的本地化字符串。
/// Looks up a localized string similar to Subscription content decoding failed (non-BASE64 code).
/// </summary>
internal static string MsgSubscriptionDecodingFailed {
get {
@@ -502,7 +502,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 is unpacking... 的本地化字符串。
/// Looks up a localized string similar to is unpacking....
/// </summary>
internal static string MsgUnpacking {
get {
@@ -511,7 +511,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Update subscription end 的本地化字符串。
/// Looks up a localized string similar to Update subscription end.
/// </summary>
internal static string MsgUpdateSubscriptionEnd {
get {
@@ -520,7 +520,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Update subscription starts 的本地化字符串。
/// Looks up a localized string similar to Update subscription starts.
/// </summary>
internal static string MsgUpdateSubscriptionStart {
get {
@@ -529,7 +529,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Update V2rayCore successfully 的本地化字符串。
/// Looks up a localized string similar to Update V2rayCore successfully.
/// </summary>
internal static string MsgUpdateV2rayCoreSuccessfully {
get {
@@ -538,7 +538,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Update V2rayCore successfully! Restarting service... 的本地化字符串。
/// Looks up a localized string similar to Update V2rayCore successfully! Restarting service....
/// </summary>
internal static string MsgUpdateV2rayCoreSuccessfullyMore {
get {
@@ -547,7 +547,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 This feature relies on the Http global proxy, please set it correctly first. 的本地化字符串。
/// Looks up a localized string similar to This feature relies on the Http global proxy, please set it correctly first..
/// </summary>
internal static string NeedHttpGlobalProxy {
get {
@@ -556,7 +556,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Non-vmess or ss protocol 的本地化字符串。
/// Looks up a localized string similar to Non-vmess or ss protocol.
/// </summary>
internal static string NonvmessOrssProtocol {
get {
@@ -565,7 +565,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 non-Vmess service, this feature is invalid 的本地化字符串。
/// Looks up a localized string similar to non-Vmess service, this feature is invalid.
/// </summary>
internal static string NonVmessService {
get {
@@ -574,7 +574,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 V2ray-core not found, download address: {0} 的本地化字符串。
/// Looks up a localized string similar to V2ray-core not found, download address: {0}.
/// </summary>
internal static string NotFoundCore {
get {
@@ -583,7 +583,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Scan completed, no valid QR code found 的本地化字符串。
/// Looks up a localized string similar to Scan completed, no valid QR code found.
/// </summary>
internal static string NoValidQRcodeFound {
get {
@@ -592,7 +592,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 operation failed, please check retry 的本地化字符串。
/// Looks up a localized string similar to operation failed, please check retry.
/// </summary>
internal static string OperationFailed {
get {
@@ -601,7 +601,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please Fill Remarks 的本地化字符串。
/// Looks up a localized string similar to Please Fill Remarks.
/// </summary>
internal static string PleaseFillRemarks {
get {
@@ -610,7 +610,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please select the encryption method 的本地化字符串。
/// Looks up a localized string similar to Please select the encryption method.
/// </summary>
internal static string PleaseSelectEncryption {
get {
@@ -619,7 +619,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please select an agreement 的本地化字符串。
/// Looks up a localized string similar to Please select an agreement.
/// </summary>
internal static string PleaseSelectProtocol {
get {
@@ -628,7 +628,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Please select the server first 的本地化字符串。
/// Looks up a localized string similar to Please select the server first.
/// </summary>
internal static string PleaseSelectServer {
get {
@@ -637,7 +637,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 QuickFresh 的本地化字符串。
/// Looks up a localized string similar to QuickFresh.
/// </summary>
internal static string QuickFresh {
get {
@@ -646,7 +646,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Are you sure to remove the server? 的本地化字符串。
/// Looks up a localized string similar to Are you sure to remove the server?.
/// </summary>
internal static string RemoveServer {
get {
@@ -655,7 +655,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 The client configuration file is saved at: {0} 的本地化字符串。
/// Looks up a localized string similar to The client configuration file is saved at: {0}.
/// </summary>
internal static string SaveClientConfigurationIn {
get {
@@ -664,7 +664,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 The server configuration file is saved at: {0} 的本地化字符串。
/// Looks up a localized string similar to The server configuration file is saved at: {0}.
/// </summary>
internal static string SaveServerConfigurationIn {
get {
@@ -673,7 +673,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 SlowFresh 的本地化字符串。
/// Looks up a localized string similar to SlowFresh.
/// </summary>
internal static string SlowFresh {
get {
@@ -682,7 +682,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node! 的本地化字符串。
/// Looks up a localized string similar to Note: After this function relies on the Http global proxy test, please manually adjust the Http global proxy and active node!.
/// </summary>
internal static string SpeedServerTips {
get {
@@ -691,16 +691,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 PAC failed to start. Pls with an administrator. 的本地化字符串。
/// </summary>
internal static string StartPacFailed {
get {
return ResourceManager.GetString("StartPacFailed", resourceCulture);
}
}
/// <summary>
/// 查找类似 Start service ({0})...... 的本地化字符串。
/// Looks up a localized string similar to Start service ({0}).......
/// </summary>
internal static string StartService {
get {
@@ -709,8 +700,8 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Successful configuration
///{0} 的本地化字符串。
/// Looks up a localized string similar to Successful configuration
///{0}.
/// </summary>
internal static string SuccessfulConfiguration {
get {
@@ -719,7 +710,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Successfully imported custom configuration server 的本地化字符串。
/// Looks up a localized string similar to Successfully imported custom configuration server.
/// </summary>
internal static string SuccessfullyImportedCustomServer {
get {
@@ -728,7 +719,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Imported bulk URL from clipboard successfully 的本地化字符串。
/// Looks up a localized string similar to Imported bulk URL from clipboard successfully.
/// </summary>
internal static string SuccessfullyImportedServerViaClipboard {
get {
@@ -737,12 +728,21 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Scan import URL successfully 的本地化字符串。
/// Looks up a localized string similar to Scan import URL successfully.
/// </summary>
internal static string SuccessfullyImportedServerViaScan {
get {
return ResourceManager.GetString("SuccessfullyImportedServerViaScan", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to UP.
/// </summary>
internal static string uploadSpeed {
get {
return ResourceManager.GetString("uploadSpeed", resourceCulture);
}
}
}
}
+2 -2
View File
@@ -343,7 +343,7 @@
<data name="LvTotalUploadDataAmount" xml:space="preserve">
<value>Total upload traffic</value>
</data>
<data name="StartPacFailed" xml:space="preserve">
<value>PAC failed to start. Pls with an administrator.</value>
<data name="uploadSpeed" xml:space="preserve">
<value>UP</value>
</data>
</root>
+2 -2
View File
@@ -343,7 +343,7 @@
<data name="LvTotalUploadDataAmount" xml:space="preserve">
<value>总上传</value>
</data>
<data name="StartPacFailed" xml:space="preserve">
<value>PAC服务启动失败,请用管理员启动</value>
<data name="uploadSpeed" xml:space="preserve">
<value>上传</value>
</data>
</root>
-2
View File
@@ -179,7 +179,6 @@
<Compile Include="Forms\SubSettingControl.Designer.cs">
<DependentUpon>SubSettingControl.cs</DependentUpon>
</Compile>
<Compile Include="Handler\SpeedtestHandler.cs" />
<Compile Include="Handler\StatisticsHandler.cs" />
<Compile Include="Handler\V2rayUpdateHandle.cs" />
<Compile Include="HttpProxyHandler\HttpWebServer.cs" />
@@ -428,7 +427,6 @@
</Content>
<EmbeddedResource Include="LIB\netstandard.dll" />
<Content Include="Resources\help.png" />
<None Include="Resources\notify.png" />
<Content Include="Resources\privoxy_conf.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />