Compare commits

...

11 Commits
3.17 ... 3.19

Author SHA1 Message Date
2dust
a799420d0f v2fly 2020-06-04 08:31:18 +08:00
2dust
70069a05e6 Update README.md 2020-06-04 08:08:30 +08:00
2dust
d385b44a48 Merge pull request #735 from rprx/patch-5
允许不安全连接 -> 跳过证书验证
2020-04-25 09:29:23 +08:00
rprx
56c1557f4a 允许不安全连接 -> 跳过证书验证
https://github.com/2dust/v2rayN/pull/733
2020-04-24 02:57:38 +00:00
2dust
737d563ebb up speedtest 2020-04-23 16:20:30 +08:00
2dust
81b70195cf Merge pull request #730 from rprx/patch-3
Update UI
2020-04-23 16:11:34 +08:00
2dust
e60851153b Merge pull request #728 from rprx/patch-2
Delete #routingobject
2020-04-23 16:11:23 +08:00
rprx
009a15f0d9 Update UI
Update UI
2020-04-23 07:27:13 +00:00
rprx
f234775bd5 Delete #routingobject
打开页面时露出上方“路由功能”的描述
2020-04-23 06:31:10 +00:00
2dust
9b8bd0fa8a Merge pull request #725 from rprx/patch-1
v2ray.com -> v2fly.org
2020-04-23 13:51:29 +08:00
rprx
f74191946c v2ray.com -> v2fly.org
v2ray.com -> v2fly.org
2020-04-23 05:48:34 +00:00
9 changed files with 47 additions and 49 deletions

View File

@@ -7,4 +7,4 @@
### Requirements
- Microsoft [.NET Framework 4.6](https://docs.microsoft.com/zh-cn/dotnet/framework/install/guide-for-developers) or higher
- Project V core [https://github.com/v2ray/v2ray-core/releases](https://github.com/v2ray/v2ray-core/releases)
- Project V core [https://github.com/v2fly/v2ray-core/releases](https://github.com/v2fly/v2ray-core/releases)

View File

@@ -149,7 +149,7 @@
<value>203, 12</value>
</data>
<data name="label21.Text" xml:space="preserve">
<value>是否允许不安全连接(allowInsecure)</value>
<value>跳过证书验证(allowInsecure)</value>
</data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>223, 7</value>

View File

@@ -444,7 +444,7 @@ namespace v2rayN.Forms
private void linkLabelRoutingDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://www.v2ray.com/chapter_02/03_routing.html#routingobject");
System.Diagnostics.Process.Start("https://www.v2fly.org/chapter_02/03_routing.html");
}
}

View File

@@ -128,7 +128,7 @@
<value>222, 16</value>
</data>
<data name="chkdefAllowInsecure.Text" xml:space="preserve">
<value>是否允许不安全连接(allowInsecure)</value>
<value>底层传输安全选tls时默认跳过证书验证(allowInsecure)</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>

View File

@@ -6,7 +6,7 @@ namespace v2rayN
#region
public const string v2rayWebsiteUrl = @"https://www.v2ray.com/";
public const string v2rayWebsiteUrl = @"https://www.v2fly.org/";
public const string AboutUrl = @"https://github.com/2dust/v2rayN";
public const string UpdateUrl = AboutUrl + @"/releases";

View File

@@ -54,8 +54,8 @@ namespace v2rayN.Handler
private readonly string nLatestUrl = "https://github.com/2dust/v2rayN/releases/latest";
private const string nUrl = "https://github.com/2dust/v2rayN/releases/download/{0}/v2rayN.zip";
private readonly 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";
private readonly string coreLatestUrl = "https://github.com/v2fly/v2ray-core/releases/latest";
private const string coreUrl = "https://github.com/v2fly/v2ray-core/releases/download/{0}/v2ray-windows-{1}.zip";
public async void CheckUpdateAsync(string type)
{
@@ -101,7 +101,7 @@ namespace v2rayN.Handler
string filePath = Utils.GetPath("V2ray.exe");
if (!File.Exists(filePath))
{
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"https://github.com/v2ray/v2ray-core/releases");
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"https://github.com/v2fly/v2ray-core/releases");
//ShowMsg(true, msg);
return "";
}
@@ -136,13 +136,15 @@ namespace v2rayN.Handler
string curVersion;
string message;
string url;
if (type == "Core") {
if (type == "Core")
{
curVersion = "v" + getV2rayVersion();
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion);
string osBit = Environment.Is64BitProcess ? "64" : "32";
url = string.Format(coreUrl, version, osBit);
}
else if (type == "v2rayN") {
else if (type == "v2rayN")
{
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
message = string.Format(UIRes.I18N("IsLatestN"), curVersion);
url = string.Format(nUrl, version);
@@ -172,8 +174,9 @@ namespace v2rayN.Handler
#region Download
public void DownloadFileAsync(string url, WebProxy webProxy, int downloadTimeout)
public WebClientEx DownloadFileAsync(string url, WebProxy webProxy, int downloadTimeout)
{
WebClientEx ws = new WebClientEx();
try
{
Utils.SetSecurityProtocol();
@@ -182,7 +185,7 @@ namespace v2rayN.Handler
progressPercentage = -1;
totalBytesToReceive = 0;
WebClientEx ws = new WebClientEx();
//WebClientEx ws = new WebClientEx();
DownloadTimeout = downloadTimeout;
if (webProxy != null)
{
@@ -199,6 +202,7 @@ namespace v2rayN.Handler
Error?.Invoke(this, new ErrorEventArgs(ex));
}
return ws;
}
void ws_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)

View File

@@ -11,26 +11,17 @@ namespace v2rayN.Handler
{
class SpeedtestHandler
{
private DownloadHandle downloadHandle2;
private Config _config;
private V2rayHandler _v2rayHandler;
private List<int> _selecteds;
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;
_selecteds = Utils.DeepCopy(selecteds);
_updateFunc = update;
if (actionType == "ping")
@@ -178,6 +169,7 @@ namespace v2rayN.Handler
private void RunSpeedTest()
{
int testCounter = 0;
int pid = -1;
if (_config.vmess.Count <= 0)
@@ -188,39 +180,41 @@ namespace v2rayN.Handler
pid = _v2rayHandler.LoadV2rayConfigString(_config, _selecteds);
string url = _config.speedTestUrl;
testCounter = 0;
if (downloadHandle2 == null)
DownloadHandle downloadHandle2 = new DownloadHandle();
downloadHandle2.UpdateCompleted += (sender2, args) =>
{
downloadHandle2 = new DownloadHandle();
downloadHandle2.UpdateCompleted += (sender2, args) =>
{
_updateFunc(ItemIndex, args.Msg);
if (args.Success) StartNext();
};
downloadHandle2.Error += (sender2, args) =>
{
_updateFunc(ItemIndex, args.GetException().Message);
StartNext();
};
}
StartNext();
void StartNext()
_updateFunc(testCounter, args.Msg);
};
downloadHandle2.Error += (sender2, args) =>
{
if (testCounter >= _selecteds.Count)
_updateFunc(testCounter, args.GetException().Message);
};
var timeout = 12;
foreach (int itemIndex in _selecteds)
{
if (itemIndex >= _config.vmess.Count)
{
if (pid > 0) _v2rayHandler.V2rayStopPid(pid);
return;
break;
}
if (_config.vmess[itemIndex].configType == (int)EConfigType.Custom)
{
continue;
}
testCounter = itemIndex;
int httpPort = _config.GetLocalPort("speedtest");
int index = _selecteds[testCounter];
testCounter++;
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort + index);
downloadHandle2.DownloadFileAsync(url, webProxy, 10);
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort + itemIndex);
var ws = downloadHandle2.DownloadFileAsync(url, webProxy, timeout - 2);
Thread.Sleep(1000 * timeout);
ws.CancelAsync();
Thread.Sleep(1000 * 2);
}
if (pid > 0) _v2rayHandler.V2rayStopPid(pid);
}

View File

@@ -174,7 +174,7 @@ namespace v2rayN.Handler
}
if (Utils.IsNullOrEmpty(fileName))
{
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"https://github.com/v2ray/v2ray-core/releases");
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"https://github.com/v2fly/v2ray-core/releases");
ShowMsg(false, msg);
}
return fileName;

View File

@@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
// 方法是按如下所示使用“*”:
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("3.17")]
[assembly: AssemblyFileVersion("3.19")]