Compare commits

..

7 Commits
3.27 ... 3.29

Author SHA1 Message Date
2dust
47dce69aa4 up 2020-12-05 18:13:24 +08:00
2dust
3aeaadade6 remove connectionReuse 2020-12-05 18:12:55 +08:00
2dust
162b3ab29c Update AssemblyInfo.cs 2020-11-29 20:44:02 +08:00
2dust
b8848823cd add xray start 2020-11-29 20:43:26 +08:00
2dust
378f350c52 ToJsonFile 2020-11-23 21:18:44 +08:00
2dust
e7231d33b3 Merge pull request #1095 from nkh0472/patch-1
与最新的在线默认规则保持一致
2020-11-05 10:34:50 +08:00
nkh0472
7c633374f6 与最新的在线默认规则保持一致
category-ads-all包含category-ads,并增添了提供广告的域名。
详见https://github.com/v2fly/domain-list-community/blob/master/data/category-ads-all
2020-11-04 10:04:42 +08:00
7 changed files with 22 additions and 26 deletions

View File

@@ -847,7 +847,7 @@ namespace v2rayN.Forms
{
//刷新
RefreshServers();
LoadV2ray();
//LoadV2ray();
UI.Show(UIRes.I18N("SuccessfullyImportedCustomServer"));
}
else
@@ -1136,7 +1136,7 @@ namespace v2rayN.Forms
{
//TODO: reload is not good.
RefreshServers();
LoadV2ray();
//LoadV2ray();
}
}
private void menuSelectAll_Click(object sender, EventArgs e)

View File

@@ -84,7 +84,7 @@ namespace v2rayN.Handler
// TODO: 统计配置
statistic(config, ref v2rayConfig);
Utils.ToJsonFile(v2rayConfig, fileName);
Utils.ToJsonFile(v2rayConfig, fileName, false);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
}
@@ -624,8 +624,7 @@ namespace v2rayN.Handler
//ws
case "ws":
WsSettings wsSettings = new WsSettings
{
connectionReuse = true
{
};
string path = config.path();
@@ -689,7 +688,6 @@ namespace v2rayN.Handler
{
TcpSettings tcpSettings = new TcpSettings
{
connectionReuse = true,
header = new Header
{
type = config.headerType()
@@ -919,7 +917,7 @@ namespace v2rayN.Handler
//传出设置
ServerOutbound(config, ref v2rayConfig);
Utils.ToJsonFile(v2rayConfig, fileName);
Utils.ToJsonFile(v2rayConfig, fileName, false);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
}

View File

@@ -30,6 +30,7 @@ namespace v2rayN.Handler
{
lstV2ray = new List<string>
{
"xray",
"wv2ray",
"v2ray"
};
@@ -161,7 +162,7 @@ namespace v2rayN.Handler
private string V2rayFindexe() {
//查找v2ray文件是否存在
string fileName = string.Empty;
lstV2ray.Reverse();
//lstV2ray.Reverse();
foreach (string name in lstV2ray)
{
string vName = string.Format("{0}.exe", name);

View File

@@ -420,11 +420,7 @@ namespace v2rayN.Mode
}
public class TcpSettings
{
/// <summary>
/// 是否重用 TCP 连接
/// </summary>
public bool connectionReuse { get; set; }
{
/// <summary>
/// 数据包头部伪装设置
/// </summary>
@@ -488,12 +484,7 @@ namespace v2rayN.Mode
}
public class WsSettings
{
/// <summary>
///
/// </summary>
public bool connectionReuse { get; set; }
{
/// <summary>
///
/// </summary>

View File

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

View File

@@ -1 +1 @@
geosite:category-ads,
geosite:category-ads-all,

View File

@@ -119,16 +119,22 @@ namespace v2rayN
/// <param name="obj"></param>
/// <param name="filePath"></param>
/// <returns></returns>
public static int ToJsonFile(Object obj, string filePath)
public static int ToJsonFile(Object obj, string filePath, bool nullValue = true)
{
int result;
try
{
using (StreamWriter file = File.CreateText(filePath))
{
//JsonSerializer serializer = new JsonSerializer();
JsonSerializer serializer = new JsonSerializer() { Formatting = Formatting.Indented };
//JsonSerializer serializer = new JsonSerializer() { Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore };
JsonSerializer serializer;
if (nullValue)
{
serializer = new JsonSerializer() { Formatting = Formatting.Indented };
}
else
{
serializer = new JsonSerializer() { Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore };
}
serializer.Serialize(file, obj);
}
@@ -800,7 +806,7 @@ namespace v2rayN
public static string GetTempPath(string filename)
{
return Path.Combine(GetTempPath(), filename);
}
}
public static string UnGzip(byte[] buf)
{