mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 21:52:25 +00:00
commit
5ba9ab14a0
27 changed files with 2171 additions and 2417 deletions
|
@ -61,6 +61,7 @@ namespace v2rayN.Base
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string address = ctx.Request.LocalEndPoint.Address.ToString();
|
string address = ctx.Request.LocalEndPoint.Address.ToString();
|
||||||
|
Utils.SaveLog("Webserver Request " + address);
|
||||||
string rstr = _responderMethod(address);
|
string rstr = _responderMethod(address);
|
||||||
byte[] buf = Encoding.UTF8.GetBytes(rstr);
|
byte[] buf = Encoding.UTF8.GetBytes(rstr);
|
||||||
ctx.Response.StatusCode = 200;
|
ctx.Response.StatusCode = 200;
|
||||||
|
|
|
@ -39,8 +39,15 @@ namespace v2rayN.Base
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
if (!listener.Pending())
|
||||||
|
{
|
||||||
|
Thread.Sleep(100);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
TcpClient socket = listener.AcceptTcpClient();
|
TcpClient socket = listener.AcceptTcpClient();
|
||||||
Thread thread = new Thread(new ParameterizedThreadStart(ProcessThread));
|
Thread thread = new Thread(new ParameterizedThreadStart(ProcessThread));
|
||||||
|
thread.IsBackground = true;
|
||||||
thread.Start(socket);
|
thread.Start(socket);
|
||||||
Thread.Sleep(1);
|
Thread.Sleep(1);
|
||||||
}
|
}
|
||||||
|
@ -62,6 +69,7 @@ namespace v2rayN.Base
|
||||||
if (_responderMethod != null)
|
if (_responderMethod != null)
|
||||||
{
|
{
|
||||||
var address = ((IPEndPoint)socket.Client.LocalEndPoint).Address.ToString();
|
var address = ((IPEndPoint)socket.Client.LocalEndPoint).Address.ToString();
|
||||||
|
Utils.SaveLog("WebserverB Request " + address);
|
||||||
string pac = _responderMethod(address);
|
string pac = _responderMethod(address);
|
||||||
|
|
||||||
if (inputStream.CanWrite)
|
if (inputStream.CanWrite)
|
||||||
|
|
|
@ -33,6 +33,14 @@ namespace v2rayN.Forms
|
||||||
Application.ApplicationExit += (sender, args) =>
|
Application.ApplicationExit += (sender, args) =>
|
||||||
{
|
{
|
||||||
Utils.ClearTempPath();
|
Utils.ClearTempPath();
|
||||||
|
|
||||||
|
v2rayHandler.V2rayStop();
|
||||||
|
HttpProxyHandle.Update(config, true);
|
||||||
|
HttpProxyHandle.CloseHttpAgent(config);
|
||||||
|
PACServerHandle.Stop();
|
||||||
|
|
||||||
|
ConfigHandler.SaveConfig(ref config);
|
||||||
|
statistics?.SaveToFile();
|
||||||
statistics?.Close();
|
statistics?.Close();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -79,18 +87,9 @@ namespace v2rayN.Forms
|
||||||
if (e.CloseReason == CloseReason.UserClosing)
|
if (e.CloseReason == CloseReason.UserClosing)
|
||||||
{
|
{
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
|
|
||||||
statistics?.SaveToFile();
|
|
||||||
|
|
||||||
HideForm();
|
HideForm();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (e.CloseReason == CloseReason.ApplicationExitCall)
|
|
||||||
{
|
|
||||||
ConfigHandler.SaveConfig(ref config);
|
|
||||||
statistics?.SaveToFile();
|
|
||||||
statistics?.Close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainForm_Resize(object sender, EventArgs e)
|
private void MainForm_Resize(object sender, EventArgs e)
|
||||||
|
@ -117,7 +116,7 @@ namespace v2rayN.Forms
|
||||||
{
|
{
|
||||||
case WM_QUERYENDSESSION:
|
case WM_QUERYENDSESSION:
|
||||||
Utils.SaveLog("Windows shutdown UnsetProxy");
|
Utils.SaveLog("Windows shutdown UnsetProxy");
|
||||||
//CloseV2ray();
|
|
||||||
ConfigHandler.ToJsonFile(config);
|
ConfigHandler.ToJsonFile(config);
|
||||||
statistics?.SaveToFile();
|
statistics?.SaveToFile();
|
||||||
ProxySetting.UnsetProxy();
|
ProxySetting.UnsetProxy();
|
||||||
|
@ -329,7 +328,7 @@ namespace v2rayN.Forms
|
||||||
|
|
||||||
if (config.sysAgentEnabled)
|
if (config.sysAgentEnabled)
|
||||||
{
|
{
|
||||||
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.sysAgentPort}";
|
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.httpPort}";
|
||||||
if (config.listenerType == 2 || config.listenerType == 4)
|
if (config.listenerType == 2 || config.listenerType == 4)
|
||||||
{
|
{
|
||||||
if (PACServerHandle.IsRunning)
|
if (PACServerHandle.IsRunning)
|
||||||
|
@ -1008,15 +1007,10 @@ namespace v2rayN.Forms
|
||||||
|
|
||||||
private void menuExit_Click(object sender, EventArgs e)
|
private void menuExit_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
CloseV2ray();
|
|
||||||
|
|
||||||
this.Visible = false;
|
this.Visible = false;
|
||||||
this.Close();
|
this.Close();
|
||||||
|
|
||||||
statistics?.Close();
|
|
||||||
|
|
||||||
//this.Dispose();
|
|
||||||
//System.Environment.Exit(System.Environment.ExitCode);
|
|
||||||
Application.Exit();
|
Application.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1253,7 +1247,7 @@ namespace v2rayN.Forms
|
||||||
{
|
{
|
||||||
if (isChecked)
|
if (isChecked)
|
||||||
{
|
{
|
||||||
if (HttpProxyHandle.RestartHttpAgent(config, true))
|
if (HttpProxyHandle.RestartHttpAgent(config, false))
|
||||||
{
|
{
|
||||||
ChangePACButtonStatus(config.listenerType);
|
ChangePACButtonStatus(config.listenerType);
|
||||||
}
|
}
|
||||||
|
@ -1300,7 +1294,7 @@ namespace v2rayN.Forms
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
downloadHandle.DownloadFileAsync(config, url, false);
|
downloadHandle.DownloadFileAsync(config, url, null);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
74
v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs
generated
74
v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs
generated
|
@ -28,7 +28,6 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionSettingForm));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionSettingForm));
|
||||||
this.btnClose = new System.Windows.Forms.Button();
|
this.btnClose = new System.Windows.Forms.Button();
|
||||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||||
|
@ -63,8 +62,9 @@
|
||||||
this.txtUserblock = new System.Windows.Forms.TextBox();
|
this.txtUserblock = new System.Windows.Forms.TextBox();
|
||||||
this.panel3 = new System.Windows.Forms.Panel();
|
this.panel3 = new System.Windows.Forms.Panel();
|
||||||
this.btnSetDefRountingRule = new System.Windows.Forms.Button();
|
this.btnSetDefRountingRule = new System.Windows.Forms.Button();
|
||||||
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
|
|
||||||
this.labRoutingTips = new System.Windows.Forms.Label();
|
this.labRoutingTips = new System.Windows.Forms.Label();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
|
||||||
this.label15 = new System.Windows.Forms.Label();
|
this.label15 = new System.Windows.Forms.Label();
|
||||||
this.label12 = new System.Windows.Forms.Label();
|
this.label12 = new System.Windows.Forms.Label();
|
||||||
this.cmbroutingMode = new System.Windows.Forms.ComboBox();
|
this.cmbroutingMode = new System.Windows.Forms.ComboBox();
|
||||||
|
@ -95,7 +95,6 @@
|
||||||
this.panel2 = new System.Windows.Forms.Panel();
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
this.btnOK = new System.Windows.Forms.Button();
|
this.btnOK = new System.Windows.Forms.Button();
|
||||||
this.panel1 = new System.Windows.Forms.Panel();
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
this.configBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
|
||||||
this.tabControl1.SuspendLayout();
|
this.tabControl1.SuspendLayout();
|
||||||
this.tabPage1.SuspendLayout();
|
this.tabPage1.SuspendLayout();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
|
@ -109,36 +108,36 @@
|
||||||
this.tabPage6.SuspendLayout();
|
this.tabPage6.SuspendLayout();
|
||||||
this.tabPage7.SuspendLayout();
|
this.tabPage7.SuspendLayout();
|
||||||
this.panel2.SuspendLayout();
|
this.panel2.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.configBindingSource)).BeginInit();
|
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// btnClose
|
// btnClose
|
||||||
//
|
//
|
||||||
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
|
||||||
resources.ApplyResources(this.btnClose, "btnClose");
|
resources.ApplyResources(this.btnClose, "btnClose");
|
||||||
|
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
this.btnClose.Name = "btnClose";
|
this.btnClose.Name = "btnClose";
|
||||||
this.btnClose.UseVisualStyleBackColor = true;
|
this.btnClose.UseVisualStyleBackColor = true;
|
||||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||||
//
|
//
|
||||||
// tabControl1
|
// tabControl1
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.tabControl1, "tabControl1");
|
||||||
this.tabControl1.Controls.Add(this.tabPage1);
|
this.tabControl1.Controls.Add(this.tabPage1);
|
||||||
this.tabControl1.Controls.Add(this.tabPage2);
|
this.tabControl1.Controls.Add(this.tabPage2);
|
||||||
this.tabControl1.Controls.Add(this.tabPage6);
|
this.tabControl1.Controls.Add(this.tabPage6);
|
||||||
this.tabControl1.Controls.Add(this.tabPage7);
|
this.tabControl1.Controls.Add(this.tabPage7);
|
||||||
resources.ApplyResources(this.tabControl1, "tabControl1");
|
|
||||||
this.tabControl1.Name = "tabControl1";
|
this.tabControl1.Name = "tabControl1";
|
||||||
this.tabControl1.SelectedIndex = 0;
|
this.tabControl1.SelectedIndex = 0;
|
||||||
//
|
//
|
||||||
// tabPage1
|
// tabPage1
|
||||||
//
|
//
|
||||||
this.tabPage1.Controls.Add(this.groupBox1);
|
|
||||||
resources.ApplyResources(this.tabPage1, "tabPage1");
|
resources.ApplyResources(this.tabPage1, "tabPage1");
|
||||||
|
this.tabPage1.Controls.Add(this.groupBox1);
|
||||||
this.tabPage1.Name = "tabPage1";
|
this.tabPage1.Name = "tabPage1";
|
||||||
this.tabPage1.UseVisualStyleBackColor = true;
|
this.tabPage1.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// groupBox1
|
// groupBox1
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||||
this.groupBox1.Controls.Add(this.chksniffingEnabled2);
|
this.groupBox1.Controls.Add(this.chksniffingEnabled2);
|
||||||
this.groupBox1.Controls.Add(this.chksniffingEnabled);
|
this.groupBox1.Controls.Add(this.chksniffingEnabled);
|
||||||
this.groupBox1.Controls.Add(this.txtremoteDNS);
|
this.groupBox1.Controls.Add(this.txtremoteDNS);
|
||||||
|
@ -157,7 +156,6 @@
|
||||||
this.groupBox1.Controls.Add(this.label5);
|
this.groupBox1.Controls.Add(this.label5);
|
||||||
this.groupBox1.Controls.Add(this.txtlocalPort);
|
this.groupBox1.Controls.Add(this.txtlocalPort);
|
||||||
this.groupBox1.Controls.Add(this.label2);
|
this.groupBox1.Controls.Add(this.label2);
|
||||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
|
||||||
this.groupBox1.Name = "groupBox1";
|
this.groupBox1.Name = "groupBox1";
|
||||||
this.groupBox1.TabStop = false;
|
this.groupBox1.TabStop = false;
|
||||||
//
|
//
|
||||||
|
@ -204,12 +202,12 @@
|
||||||
//
|
//
|
||||||
// cmbprotocol2
|
// cmbprotocol2
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
|
||||||
this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbprotocol2.FormattingEnabled = true;
|
this.cmbprotocol2.FormattingEnabled = true;
|
||||||
this.cmbprotocol2.Items.AddRange(new object[] {
|
this.cmbprotocol2.Items.AddRange(new object[] {
|
||||||
resources.GetString("cmbprotocol2.Items"),
|
resources.GetString("cmbprotocol2.Items"),
|
||||||
resources.GetString("cmbprotocol2.Items1")});
|
resources.GetString("cmbprotocol2.Items1")});
|
||||||
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
|
|
||||||
this.cmbprotocol2.Name = "cmbprotocol2";
|
this.cmbprotocol2.Name = "cmbprotocol2";
|
||||||
//
|
//
|
||||||
// label3
|
// label3
|
||||||
|
@ -224,8 +222,8 @@
|
||||||
//
|
//
|
||||||
// cmbprotocol
|
// cmbprotocol
|
||||||
//
|
//
|
||||||
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
|
||||||
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
|
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
|
||||||
|
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbprotocol.FormattingEnabled = true;
|
this.cmbprotocol.FormattingEnabled = true;
|
||||||
this.cmbprotocol.Items.AddRange(new object[] {
|
this.cmbprotocol.Items.AddRange(new object[] {
|
||||||
resources.GetString("cmbprotocol.Items"),
|
resources.GetString("cmbprotocol.Items"),
|
||||||
|
@ -251,6 +249,7 @@
|
||||||
//
|
//
|
||||||
// cmbloglevel
|
// cmbloglevel
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
|
||||||
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbloglevel.FormattingEnabled = true;
|
this.cmbloglevel.FormattingEnabled = true;
|
||||||
this.cmbloglevel.Items.AddRange(new object[] {
|
this.cmbloglevel.Items.AddRange(new object[] {
|
||||||
|
@ -259,7 +258,6 @@
|
||||||
resources.GetString("cmbloglevel.Items2"),
|
resources.GetString("cmbloglevel.Items2"),
|
||||||
resources.GetString("cmbloglevel.Items3"),
|
resources.GetString("cmbloglevel.Items3"),
|
||||||
resources.GetString("cmbloglevel.Items4")});
|
resources.GetString("cmbloglevel.Items4")});
|
||||||
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
|
|
||||||
this.cmbloglevel.Name = "cmbloglevel";
|
this.cmbloglevel.Name = "cmbloglevel";
|
||||||
//
|
//
|
||||||
// label5
|
// label5
|
||||||
|
@ -279,32 +277,32 @@
|
||||||
//
|
//
|
||||||
// tabPage2
|
// tabPage2
|
||||||
//
|
//
|
||||||
this.tabPage2.Controls.Add(this.groupBox2);
|
|
||||||
resources.ApplyResources(this.tabPage2, "tabPage2");
|
resources.ApplyResources(this.tabPage2, "tabPage2");
|
||||||
|
this.tabPage2.Controls.Add(this.groupBox2);
|
||||||
this.tabPage2.Name = "tabPage2";
|
this.tabPage2.Name = "tabPage2";
|
||||||
this.tabPage2.UseVisualStyleBackColor = true;
|
this.tabPage2.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// groupBox2
|
// groupBox2
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.groupBox2, "groupBox2");
|
||||||
this.groupBox2.Controls.Add(this.tabControl2);
|
this.groupBox2.Controls.Add(this.tabControl2);
|
||||||
this.groupBox2.Controls.Add(this.panel3);
|
this.groupBox2.Controls.Add(this.panel3);
|
||||||
resources.ApplyResources(this.groupBox2, "groupBox2");
|
|
||||||
this.groupBox2.Name = "groupBox2";
|
this.groupBox2.Name = "groupBox2";
|
||||||
this.groupBox2.TabStop = false;
|
this.groupBox2.TabStop = false;
|
||||||
//
|
//
|
||||||
// tabControl2
|
// tabControl2
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.tabControl2, "tabControl2");
|
||||||
this.tabControl2.Controls.Add(this.tabPage3);
|
this.tabControl2.Controls.Add(this.tabPage3);
|
||||||
this.tabControl2.Controls.Add(this.tabPage4);
|
this.tabControl2.Controls.Add(this.tabPage4);
|
||||||
this.tabControl2.Controls.Add(this.tabPage5);
|
this.tabControl2.Controls.Add(this.tabPage5);
|
||||||
resources.ApplyResources(this.tabControl2, "tabControl2");
|
|
||||||
this.tabControl2.Name = "tabControl2";
|
this.tabControl2.Name = "tabControl2";
|
||||||
this.tabControl2.SelectedIndex = 0;
|
this.tabControl2.SelectedIndex = 0;
|
||||||
//
|
//
|
||||||
// tabPage3
|
// tabPage3
|
||||||
//
|
//
|
||||||
this.tabPage3.Controls.Add(this.txtUseragent);
|
|
||||||
resources.ApplyResources(this.tabPage3, "tabPage3");
|
resources.ApplyResources(this.tabPage3, "tabPage3");
|
||||||
|
this.tabPage3.Controls.Add(this.txtUseragent);
|
||||||
this.tabPage3.Name = "tabPage3";
|
this.tabPage3.Name = "tabPage3";
|
||||||
this.tabPage3.UseVisualStyleBackColor = true;
|
this.tabPage3.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
@ -315,8 +313,8 @@
|
||||||
//
|
//
|
||||||
// tabPage4
|
// tabPage4
|
||||||
//
|
//
|
||||||
this.tabPage4.Controls.Add(this.txtUserdirect);
|
|
||||||
resources.ApplyResources(this.tabPage4, "tabPage4");
|
resources.ApplyResources(this.tabPage4, "tabPage4");
|
||||||
|
this.tabPage4.Controls.Add(this.txtUserdirect);
|
||||||
this.tabPage4.Name = "tabPage4";
|
this.tabPage4.Name = "tabPage4";
|
||||||
this.tabPage4.UseVisualStyleBackColor = true;
|
this.tabPage4.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
@ -327,8 +325,8 @@
|
||||||
//
|
//
|
||||||
// tabPage5
|
// tabPage5
|
||||||
//
|
//
|
||||||
this.tabPage5.Controls.Add(this.txtUserblock);
|
|
||||||
resources.ApplyResources(this.tabPage5, "tabPage5");
|
resources.ApplyResources(this.tabPage5, "tabPage5");
|
||||||
|
this.tabPage5.Controls.Add(this.txtUserblock);
|
||||||
this.tabPage5.Name = "tabPage5";
|
this.tabPage5.Name = "tabPage5";
|
||||||
this.tabPage5.UseVisualStyleBackColor = true;
|
this.tabPage5.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
@ -339,13 +337,14 @@
|
||||||
//
|
//
|
||||||
// panel3
|
// panel3
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.panel3, "panel3");
|
||||||
this.panel3.Controls.Add(this.btnSetDefRountingRule);
|
this.panel3.Controls.Add(this.btnSetDefRountingRule);
|
||||||
this.panel3.Controls.Add(this.cmbdomainStrategy);
|
|
||||||
this.panel3.Controls.Add(this.labRoutingTips);
|
this.panel3.Controls.Add(this.labRoutingTips);
|
||||||
|
this.panel3.Controls.Add(this.label4);
|
||||||
|
this.panel3.Controls.Add(this.cmbdomainStrategy);
|
||||||
this.panel3.Controls.Add(this.label15);
|
this.panel3.Controls.Add(this.label15);
|
||||||
this.panel3.Controls.Add(this.label12);
|
this.panel3.Controls.Add(this.label12);
|
||||||
this.panel3.Controls.Add(this.cmbroutingMode);
|
this.panel3.Controls.Add(this.cmbroutingMode);
|
||||||
resources.ApplyResources(this.panel3, "panel3");
|
|
||||||
this.panel3.Name = "panel3";
|
this.panel3.Name = "panel3";
|
||||||
//
|
//
|
||||||
// btnSetDefRountingRule
|
// btnSetDefRountingRule
|
||||||
|
@ -355,23 +354,29 @@
|
||||||
this.btnSetDefRountingRule.UseVisualStyleBackColor = true;
|
this.btnSetDefRountingRule.UseVisualStyleBackColor = true;
|
||||||
this.btnSetDefRountingRule.Click += new System.EventHandler(this.btnSetDefRountingRule_Click);
|
this.btnSetDefRountingRule.Click += new System.EventHandler(this.btnSetDefRountingRule_Click);
|
||||||
//
|
//
|
||||||
|
// labRoutingTips
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
|
||||||
|
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
|
||||||
|
this.labRoutingTips.Name = "labRoutingTips";
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.label4, "label4");
|
||||||
|
this.label4.ForeColor = System.Drawing.Color.Brown;
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
//
|
||||||
// cmbdomainStrategy
|
// cmbdomainStrategy
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
|
||||||
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbdomainStrategy.FormattingEnabled = true;
|
this.cmbdomainStrategy.FormattingEnabled = true;
|
||||||
this.cmbdomainStrategy.Items.AddRange(new object[] {
|
this.cmbdomainStrategy.Items.AddRange(new object[] {
|
||||||
resources.GetString("cmbdomainStrategy.Items"),
|
resources.GetString("cmbdomainStrategy.Items"),
|
||||||
resources.GetString("cmbdomainStrategy.Items1"),
|
resources.GetString("cmbdomainStrategy.Items1"),
|
||||||
resources.GetString("cmbdomainStrategy.Items2")});
|
resources.GetString("cmbdomainStrategy.Items2")});
|
||||||
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
|
|
||||||
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
|
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
|
||||||
//
|
//
|
||||||
// labRoutingTips
|
|
||||||
//
|
|
||||||
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
|
|
||||||
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
|
|
||||||
this.labRoutingTips.Name = "labRoutingTips";
|
|
||||||
//
|
|
||||||
// label15
|
// label15
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.label15, "label15");
|
resources.ApplyResources(this.label15, "label15");
|
||||||
|
@ -384,6 +389,7 @@
|
||||||
//
|
//
|
||||||
// cmbroutingMode
|
// cmbroutingMode
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
|
||||||
this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbroutingMode.FormattingEnabled = true;
|
this.cmbroutingMode.FormattingEnabled = true;
|
||||||
this.cmbroutingMode.Items.AddRange(new object[] {
|
this.cmbroutingMode.Items.AddRange(new object[] {
|
||||||
|
@ -391,11 +397,11 @@
|
||||||
resources.GetString("cmbroutingMode.Items1"),
|
resources.GetString("cmbroutingMode.Items1"),
|
||||||
resources.GetString("cmbroutingMode.Items2"),
|
resources.GetString("cmbroutingMode.Items2"),
|
||||||
resources.GetString("cmbroutingMode.Items3")});
|
resources.GetString("cmbroutingMode.Items3")});
|
||||||
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
|
|
||||||
this.cmbroutingMode.Name = "cmbroutingMode";
|
this.cmbroutingMode.Name = "cmbroutingMode";
|
||||||
//
|
//
|
||||||
// tabPage6
|
// tabPage6
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.tabPage6, "tabPage6");
|
||||||
this.tabPage6.Controls.Add(this.chkKcpcongestion);
|
this.tabPage6.Controls.Add(this.chkKcpcongestion);
|
||||||
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
|
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
|
||||||
this.tabPage6.Controls.Add(this.label10);
|
this.tabPage6.Controls.Add(this.label10);
|
||||||
|
@ -409,7 +415,6 @@
|
||||||
this.tabPage6.Controls.Add(this.label7);
|
this.tabPage6.Controls.Add(this.label7);
|
||||||
this.tabPage6.Controls.Add(this.txtKcpmtu);
|
this.tabPage6.Controls.Add(this.txtKcpmtu);
|
||||||
this.tabPage6.Controls.Add(this.label6);
|
this.tabPage6.Controls.Add(this.label6);
|
||||||
resources.ApplyResources(this.tabPage6, "tabPage6");
|
|
||||||
this.tabPage6.Name = "tabPage6";
|
this.tabPage6.Name = "tabPage6";
|
||||||
this.tabPage6.UseVisualStyleBackColor = true;
|
this.tabPage6.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
@ -481,6 +486,7 @@
|
||||||
//
|
//
|
||||||
// tabPage7
|
// tabPage7
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.tabPage7, "tabPage7");
|
||||||
this.tabPage7.Controls.Add(this.cbFreshrate);
|
this.tabPage7.Controls.Add(this.cbFreshrate);
|
||||||
this.tabPage7.Controls.Add(this.tbCacheDays);
|
this.tabPage7.Controls.Add(this.tbCacheDays);
|
||||||
this.tabPage7.Controls.Add(this.lbFreshrate);
|
this.tabPage7.Controls.Add(this.lbFreshrate);
|
||||||
|
@ -490,15 +496,14 @@
|
||||||
this.tabPage7.Controls.Add(this.txturlGFWList);
|
this.tabPage7.Controls.Add(this.txturlGFWList);
|
||||||
this.tabPage7.Controls.Add(this.label13);
|
this.tabPage7.Controls.Add(this.label13);
|
||||||
this.tabPage7.Controls.Add(this.chkAutoRun);
|
this.tabPage7.Controls.Add(this.chkAutoRun);
|
||||||
resources.ApplyResources(this.tabPage7, "tabPage7");
|
|
||||||
this.tabPage7.Name = "tabPage7";
|
this.tabPage7.Name = "tabPage7";
|
||||||
this.tabPage7.UseVisualStyleBackColor = true;
|
this.tabPage7.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// cbFreshrate
|
// cbFreshrate
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
|
||||||
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cbFreshrate.FormattingEnabled = true;
|
this.cbFreshrate.FormattingEnabled = true;
|
||||||
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
|
|
||||||
this.cbFreshrate.Name = "cbFreshrate";
|
this.cbFreshrate.Name = "cbFreshrate";
|
||||||
//
|
//
|
||||||
// tbCacheDays
|
// tbCacheDays
|
||||||
|
@ -546,9 +551,9 @@
|
||||||
//
|
//
|
||||||
// panel2
|
// panel2
|
||||||
//
|
//
|
||||||
|
resources.ApplyResources(this.panel2, "panel2");
|
||||||
this.panel2.Controls.Add(this.btnClose);
|
this.panel2.Controls.Add(this.btnClose);
|
||||||
this.panel2.Controls.Add(this.btnOK);
|
this.panel2.Controls.Add(this.btnOK);
|
||||||
resources.ApplyResources(this.panel2, "panel2");
|
|
||||||
this.panel2.Name = "panel2";
|
this.panel2.Name = "panel2";
|
||||||
//
|
//
|
||||||
// btnOK
|
// btnOK
|
||||||
|
@ -563,10 +568,6 @@
|
||||||
resources.ApplyResources(this.panel1, "panel1");
|
resources.ApplyResources(this.panel1, "panel1");
|
||||||
this.panel1.Name = "panel1";
|
this.panel1.Name = "panel1";
|
||||||
//
|
//
|
||||||
// configBindingSource
|
|
||||||
//
|
|
||||||
this.configBindingSource.DataSource = typeof(v2rayN.Mode.Config);
|
|
||||||
//
|
|
||||||
// OptionSettingForm
|
// OptionSettingForm
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this, "$this");
|
resources.ApplyResources(this, "$this");
|
||||||
|
@ -598,7 +599,6 @@
|
||||||
this.tabPage7.ResumeLayout(false);
|
this.tabPage7.ResumeLayout(false);
|
||||||
this.tabPage7.PerformLayout();
|
this.tabPage7.PerformLayout();
|
||||||
this.panel2.ResumeLayout(false);
|
this.panel2.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)(this.configBindingSource)).EndInit();
|
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -670,6 +670,6 @@
|
||||||
private System.Windows.Forms.Label lbCacheDays;
|
private System.Windows.Forms.Label lbCacheDays;
|
||||||
private System.Windows.Forms.ComboBox cbFreshrate;
|
private System.Windows.Forms.ComboBox cbFreshrate;
|
||||||
private System.Windows.Forms.Label lbFreshrate;
|
private System.Windows.Forms.Label lbFreshrate;
|
||||||
private System.Windows.Forms.BindingSource configBindingSource;
|
private System.Windows.Forms.Label label4;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -45,7 +45,7 @@ namespace v2rayN.Forms
|
||||||
chksniffingEnabled.Checked = config.inbound[0].sniffingEnabled;
|
chksniffingEnabled.Checked = config.inbound[0].sniffingEnabled;
|
||||||
|
|
||||||
txtlocalPort2.Text = "socks + 1";
|
txtlocalPort2.Text = "socks + 1";
|
||||||
cmbprotocol2.Text = "http";
|
cmbprotocol2.Text = Global.InboundHttp;
|
||||||
|
|
||||||
if (config.inbound.Count > 1)
|
if (config.inbound.Count > 1)
|
||||||
{
|
{
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -196,9 +196,21 @@
|
||||||
<data name="tabPage3.Text" xml:space="preserve">
|
<data name="tabPage3.Text" xml:space="preserve">
|
||||||
<value> 代理的Domain或IP </value>
|
<value> 代理的Domain或IP </value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="txtUserdirect.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>628, 404</value>
|
||||||
|
</data>
|
||||||
|
<data name="tabPage4.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>634, 410</value>
|
||||||
|
</data>
|
||||||
<data name="tabPage4.Text" xml:space="preserve">
|
<data name="tabPage4.Text" xml:space="preserve">
|
||||||
<value> 直连的Domain或IP </value>
|
<value> 直连的Domain或IP </value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="txtUserblock.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>628, 404</value>
|
||||||
|
</data>
|
||||||
|
<data name="tabPage5.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>634, 410</value>
|
||||||
|
</data>
|
||||||
<data name="tabPage5.Text" xml:space="preserve">
|
<data name="tabPage5.Text" xml:space="preserve">
|
||||||
<value> 阻止的Domain或IP </value>
|
<value> 阻止的Domain或IP </value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -207,7 +219,7 @@
|
||||||
<value>NoControl</value>
|
<value>NoControl</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
|
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
<value>381, 43</value>
|
<value>7, 60</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>201, 23</value>
|
<value>201, 23</value>
|
||||||
|
@ -215,25 +227,37 @@
|
||||||
<data name="btnSetDefRountingRule.Text" xml:space="preserve">
|
<data name="btnSetDefRountingRule.Text" xml:space="preserve">
|
||||||
<value>一键设置默认自定义路由规则</value>
|
<value>一键设置默认自定义路由规则</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cmbdomainStrategy.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>232, 20</value>
|
|
||||||
</data>
|
|
||||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
<data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib">
|
<data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>5, 96</value>
|
||||||
|
</data>
|
||||||
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>383, 12</value>
|
<value>383, 12</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="labRoutingTips.Text" xml:space="preserve">
|
<data name="labRoutingTips.Text" xml:space="preserve">
|
||||||
<value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value>
|
<value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="label4.Text" xml:space="preserve">
|
||||||
|
<value>规则加载次序:自定义的代理/直连/阻止,选择的路由模式</value>
|
||||||
|
</data>
|
||||||
|
<data name="cmbdomainStrategy.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>81, 30</value>
|
||||||
|
</data>
|
||||||
|
<data name="cmbdomainStrategy.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>186, 20</value>
|
||||||
|
</data>
|
||||||
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>53, 12</value>
|
<value>53, 12</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="label15.Text" xml:space="preserve">
|
<data name="label15.Text" xml:space="preserve">
|
||||||
<value>域名策略</value>
|
<value>域名策略</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>295, 34</value>
|
||||||
|
</data>
|
||||||
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>53, 12</value>
|
<value>53, 12</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -252,8 +276,11 @@
|
||||||
<data name="cmbroutingMode.Items3" xml:space="preserve">
|
<data name="cmbroutingMode.Items3" xml:space="preserve">
|
||||||
<value>绕过局域网及大陆地址</value>
|
<value>绕过局域网及大陆地址</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="cmbroutingMode.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>372, 30</value>
|
||||||
|
</data>
|
||||||
<data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>232, 20</value>
|
<value>244, 20</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tabPage2.Text" xml:space="preserve">
|
<data name="tabPage2.Text" xml:space="preserve">
|
||||||
<value> Core:路由设置 </value>
|
<value> Core:路由设置 </value>
|
||||||
|
@ -261,6 +288,24 @@
|
||||||
<data name="tabPage6.Text" xml:space="preserve">
|
<data name="tabPage6.Text" xml:space="preserve">
|
||||||
<value> Core:KCP设置 </value>
|
<value> Core:KCP设置 </value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>77, 12</value>
|
||||||
|
</data>
|
||||||
|
<data name="lbFreshrate.Text" xml:space="preserve">
|
||||||
|
<value>统计刷新频率</value>
|
||||||
|
</data>
|
||||||
|
<data name="lbCacheDays.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>305, 12</value>
|
||||||
|
</data>
|
||||||
|
<data name="lbCacheDays.Text" xml:space="preserve">
|
||||||
|
<value>缓存天数(0-30, 0关闭缓存单独每天的数据使用情况)</value>
|
||||||
|
</data>
|
||||||
|
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>384, 16</value>
|
||||||
|
</data>
|
||||||
|
<data name="chkEnableStatistics.Text" xml:space="preserve">
|
||||||
|
<value>启用统计(实时网速显示和使用流量显示,需要重启v2rayN客户端)</value>
|
||||||
|
</data>
|
||||||
<data name="chkAllowLANConn.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="chkAllowLANConn.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>144, 16</value>
|
<value>144, 16</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -288,13 +333,4 @@
|
||||||
<data name="$this.Text" xml:space="preserve">
|
<data name="$this.Text" xml:space="preserve">
|
||||||
<value>参数设置</value>
|
<value>参数设置</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="chkEnableStatistics.Text" xml:space="preserve">
|
|
||||||
<value>启用统计(实时网速显示和使用流量显示,需要重启v2rayN客户端)</value>
|
|
||||||
</data>
|
|
||||||
<data name="lbCacheDays.Text" xml:space="preserve">
|
|
||||||
<value>缓存天数(0-30, 0关闭缓存单独每天的数据使用情况)</value>
|
|
||||||
</data>
|
|
||||||
<data name="lbFreshrate.Text" xml:space="preserve">
|
|
||||||
<value>统计刷新频率</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
|
@ -102,6 +102,13 @@ namespace v2rayN
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string StreamSecurity = "tls";
|
public const string StreamSecurity = "tls";
|
||||||
|
|
||||||
|
public const string InboundSocks = "socks";
|
||||||
|
public const string InboundHttp = "http";
|
||||||
|
public const string Loopback = "127.0.0.1";
|
||||||
|
public const string InboundAPITagName = "api";
|
||||||
|
public const string InboundAPIProtocal = "dokodemo-door";
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// vmess
|
/// vmess
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -147,12 +154,6 @@ namespace v2rayN
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string CustomIconName = "v2rayN.ico";
|
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 InboundAPIProtocal = "dokodemo-door";
|
|
||||||
|
|
||||||
public enum StatisticsFreshRate
|
public enum StatisticsFreshRate
|
||||||
{
|
{
|
||||||
quick = 1000,
|
quick = 1000,
|
||||||
|
@ -177,17 +178,17 @@ namespace v2rayN
|
||||||
public static bool sysAgent { get; set; }
|
public static bool sysAgent { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// socks端口号
|
/// socks端口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static int socksPort { get; set; }
|
public static int socksPort { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 全局代理端口(http)
|
/// http端口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static int sysAgentPort { get; set; }
|
public static int httpPort { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// PAC监听端口号
|
/// PAC端口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static int pacPort { get; set; }
|
public static int pacPort { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
config.inbound = new List<InItem>();
|
config.inbound = new List<InItem>();
|
||||||
InItem inItem = new InItem();
|
InItem inItem = new InItem();
|
||||||
inItem.protocol = "socks";
|
inItem.protocol = Global.InboundSocks;
|
||||||
inItem.localPort = 10808;
|
inItem.localPort = 10808;
|
||||||
inItem.udpEnabled = true;
|
inItem.udpEnabled = true;
|
||||||
inItem.sniffingEnabled = true;
|
inItem.sniffingEnabled = true;
|
||||||
|
@ -76,7 +76,7 @@ namespace v2rayN.Handler
|
||||||
//http协议不由core提供,只保留socks
|
//http协议不由core提供,只保留socks
|
||||||
if (config.inbound.Count > 0)
|
if (config.inbound.Count > 0)
|
||||||
{
|
{
|
||||||
config.inbound[0].protocol = "socks";
|
config.inbound[0].protocol = Global.InboundSocks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//路由规则
|
//路由规则
|
||||||
|
|
|
@ -87,7 +87,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void DownloadFileAsync(Config config, string url, bool blProxy)
|
public void DownloadFileAsync(Config config, string url, WebProxy webProxy)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -101,9 +101,9 @@ namespace v2rayN.Handler
|
||||||
progressPercentage = -1;
|
progressPercentage = -1;
|
||||||
|
|
||||||
WebClientEx ws = new WebClientEx();
|
WebClientEx ws = new WebClientEx();
|
||||||
if (blProxy)
|
if (webProxy != null)
|
||||||
{
|
{
|
||||||
ws.Proxy = new WebProxy(Global.Loopback, Global.sysAgentPort);
|
ws.Proxy = webProxy;// new WebProxy(Global.Loopback, Global.httpPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
ws.DownloadFileCompleted += ws_DownloadFileCompleted;
|
ws.DownloadFileCompleted += ws_DownloadFileCompleted;
|
||||||
|
|
|
@ -37,16 +37,19 @@ namespace v2rayN.Handler
|
||||||
if (actionType == "ping")
|
if (actionType == "ping")
|
||||||
{
|
{
|
||||||
_workThread = new Thread(new ThreadStart(RunPing));
|
_workThread = new Thread(new ThreadStart(RunPing));
|
||||||
|
_workThread.IsBackground = true;
|
||||||
_workThread.Start();
|
_workThread.Start();
|
||||||
}
|
}
|
||||||
if (actionType == "tcping")
|
if (actionType == "tcping")
|
||||||
{
|
{
|
||||||
_workThread = new Thread(new ThreadStart(RunTcping));
|
_workThread = new Thread(new ThreadStart(RunTcping));
|
||||||
|
_workThread.IsBackground = true;
|
||||||
_workThread.Start();
|
_workThread.Start();
|
||||||
}
|
}
|
||||||
else if (actionType == "realping")
|
else if (actionType == "realping")
|
||||||
{
|
{
|
||||||
_workThread = new Thread(new ThreadStart(RunRealPing));
|
_workThread = new Thread(new ThreadStart(RunRealPing));
|
||||||
|
_workThread.IsBackground = true;
|
||||||
_workThread.Start();
|
_workThread.Start();
|
||||||
}
|
}
|
||||||
else if (actionType == "speedtest")
|
else if (actionType == "speedtest")
|
||||||
|
@ -88,7 +91,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread.Sleep(1);
|
Thread.Sleep(100);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -119,7 +122,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread.Sleep(1);
|
Thread.Sleep(100);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -132,6 +135,12 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
string msg = string.Empty;
|
||||||
|
|
||||||
|
Global.reloadV2ray = true;
|
||||||
|
_v2rayHandler.LoadV2ray(_config, _selecteds);
|
||||||
|
|
||||||
|
var httpPort = _config.GetLocalPort("speedtest");
|
||||||
for (int k = 0; k < _selecteds.Count; k++)
|
for (int k = 0; k < _selecteds.Count; k++)
|
||||||
{
|
{
|
||||||
int index = _selecteds[k];
|
int index = _selecteds[k];
|
||||||
|
@ -139,20 +148,12 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (ConfigHandler.SetDefaultServer(ref _config, index) == 0)
|
var webProxy = new WebProxy(Global.Loopback, httpPort + index);
|
||||||
{
|
|
||||||
_v2rayHandler.LoadV2ray(_config);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Thread.Sleep(1000 * 5);
|
|
||||||
|
|
||||||
int responseTime = -1;
|
int responseTime = -1;
|
||||||
var status = GetRealPingTime(Global.SpeedPingTestUrl, out responseTime);
|
var status = GetRealPingTime(Global.SpeedPingTestUrl, webProxy, out responseTime);
|
||||||
if (!Utils.IsNullOrEmpty(status))
|
if (!Utils.IsNullOrEmpty(status))
|
||||||
{
|
{
|
||||||
_updateFunc(index, string.Format("{0}", status));
|
_updateFunc(index, string.Format("{0}", status));
|
||||||
|
@ -166,9 +167,12 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
Utils.SaveLog(ex.Message, ex);
|
Utils.SaveLog(ex.Message, ex);
|
||||||
}
|
}
|
||||||
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread.Sleep(1);
|
Global.reloadV2ray = true;
|
||||||
|
_v2rayHandler.LoadV2ray(_config);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -184,6 +188,9 @@ namespace v2rayN.Handler
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Global.reloadV2ray = true;
|
||||||
|
_v2rayHandler.LoadV2ray(_config, _selecteds);
|
||||||
|
|
||||||
string url = Global.SpeedTestUrl;
|
string url = Global.SpeedTestUrl;
|
||||||
testCounter = 0;
|
testCounter = 0;
|
||||||
if (downloadHandle2 == null)
|
if (downloadHandle2 == null)
|
||||||
|
@ -213,6 +220,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ServerSpeedTestSub(testCounter, url) != 0)
|
if (ServerSpeedTestSub(testCounter, url) != 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -223,24 +231,20 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
if (index >= _selecteds.Count)
|
if (index >= _selecteds.Count)
|
||||||
{
|
{
|
||||||
|
Global.reloadV2ray = true;
|
||||||
|
_v2rayHandler.LoadV2ray(_config);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ConfigHandler.SetDefaultServer(ref _config, _selecteds[index]) == 0)
|
var httpPort = _config.GetLocalPort("speedtest");
|
||||||
{
|
index = _selecteds[index];
|
||||||
_v2rayHandler.LoadV2ray(_config);
|
|
||||||
|
|
||||||
testCounter++;
|
testCounter++;
|
||||||
|
var webProxy = new WebProxy(Global.Loopback, httpPort + index);
|
||||||
downloadHandle2.DownloadFileAsync(_config, url,true);
|
downloadHandle2.DownloadFileAsync(_config, url, webProxy);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int GetTcpingTime(string url, int port)
|
private int GetTcpingTime(string url, int port)
|
||||||
{
|
{
|
||||||
|
@ -267,7 +271,7 @@ namespace v2rayN.Handler
|
||||||
return responseTime;
|
return responseTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetRealPingTime(string url, out int responseTime)
|
private string GetRealPingTime(string url, WebProxy webProxy, out int responseTime)
|
||||||
{
|
{
|
||||||
string msg = string.Empty;
|
string msg = string.Empty;
|
||||||
responseTime = -1;
|
responseTime = -1;
|
||||||
|
@ -276,7 +280,7 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
|
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
|
||||||
myHttpWebRequest.Timeout = 5000;
|
myHttpWebRequest.Timeout = 5000;
|
||||||
myHttpWebRequest.Proxy = new WebProxy(Global.Loopback, Global.sysAgentPort);
|
myHttpWebRequest.Proxy = webProxy;//new WebProxy(Global.Loopback, Global.httpPort);
|
||||||
|
|
||||||
var timer = new Stopwatch();
|
var timer = new Stopwatch();
|
||||||
timer.Start();
|
timer.Start();
|
||||||
|
|
|
@ -6,7 +6,9 @@ using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
|
using v2rayN.Properties;
|
||||||
using v2rayN.Protos.Statistics;
|
using v2rayN.Protos.Statistics;
|
||||||
|
using v2rayN.Tool;
|
||||||
|
|
||||||
namespace v2rayN.Handler
|
namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
|
@ -66,6 +68,23 @@ namespace v2rayN.Handler
|
||||||
|
|
||||||
public StatisticsHandler(Mode.Config config, Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> update)
|
public StatisticsHandler(Mode.Config config, Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> update)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Environment.Is64BitOperatingSystem)
|
||||||
|
{
|
||||||
|
FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x64.dll"), Resources.grpc_csharp_ext_x64_dll);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x86.dll"), Resources.grpc_csharp_ext_x86_dll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (IOException ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
config_ = config;
|
config_ = config;
|
||||||
enabled_ = config.enableStatistics;
|
enabled_ = config.enableStatistics;
|
||||||
UpdateUI = false;
|
UpdateUI = false;
|
||||||
|
@ -86,6 +105,7 @@ namespace v2rayN.Handler
|
||||||
GrpcInit();
|
GrpcInit();
|
||||||
|
|
||||||
workThread_ = new Thread(new ThreadStart(Run));
|
workThread_ = new Thread(new ThreadStart(Run));
|
||||||
|
workThread_.IsBackground = true;
|
||||||
workThread_.Start();
|
workThread_.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +212,7 @@ namespace v2rayN.Handler
|
||||||
name = nStr[1];
|
name = nStr[1];
|
||||||
type = nStr[3];
|
type = nStr[3];
|
||||||
|
|
||||||
if (name == Global.InboundProxyTagName)
|
if (name == Global.agentTag)
|
||||||
{
|
{
|
||||||
if (type == "uplink")
|
if (type == "uplink")
|
||||||
{
|
{
|
||||||
|
|
|
@ -1365,5 +1365,90 @@ namespace v2rayN.Handler
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Gen speedtest config
|
||||||
|
|
||||||
|
|
||||||
|
public static int GenerateClientSpeedtestConfig(Config config, List<int> selecteds, string fileName, out string msg)
|
||||||
|
{
|
||||||
|
msg = string.Empty;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (config == null
|
||||||
|
|| config.index < 0
|
||||||
|
|| config.vmess.Count <= 0
|
||||||
|
|| config.index > config.vmess.Count - 1
|
||||||
|
)
|
||||||
|
{
|
||||||
|
msg = UIRes.I18N("CheckServerSettings");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = UIRes.I18N("InitialConfiguration");
|
||||||
|
|
||||||
|
string result = Utils.GetEmbedText(SampleClient);
|
||||||
|
if (Utils.IsNullOrEmpty(result))
|
||||||
|
{
|
||||||
|
msg = UIRes.I18N("FailedGetDefaultConfiguration");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
V2rayConfig v2rayConfig = Utils.FromJson<V2rayConfig>(result);
|
||||||
|
if (v2rayConfig == null)
|
||||||
|
{
|
||||||
|
msg = UIRes.I18N("FailedGenDefaultConfiguration");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
log(config, ref v2rayConfig, false);
|
||||||
|
//routing(config, ref v2rayConfig);
|
||||||
|
dns(config, ref v2rayConfig);
|
||||||
|
|
||||||
|
|
||||||
|
var httpPort = config.GetLocalPort("speedtest");
|
||||||
|
for (int k = 0; k < selecteds.Count; k++)
|
||||||
|
{
|
||||||
|
int index = selecteds[k];
|
||||||
|
if (config.vmess[index].configType == (int)EConfigType.Custom)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
config.index = index;
|
||||||
|
|
||||||
|
var inbound = new Inbounds();
|
||||||
|
inbound.listen = Global.Loopback;
|
||||||
|
inbound.port = httpPort + index;
|
||||||
|
inbound.protocol = Global.InboundHttp;
|
||||||
|
inbound.tag = Global.InboundHttp + inbound.port.ToString();
|
||||||
|
v2rayConfig.inbounds.Add(inbound);
|
||||||
|
|
||||||
|
|
||||||
|
var v2rayConfigCopy = Utils.FromJson<V2rayConfig>(result);
|
||||||
|
outbound(config, ref v2rayConfigCopy);
|
||||||
|
v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString();
|
||||||
|
v2rayConfig.outbounds.Add(v2rayConfigCopy.outbounds[0]);
|
||||||
|
|
||||||
|
var rule = new Mode.RulesItem();
|
||||||
|
rule.inboundTag = inbound.tag;
|
||||||
|
rule.outboundTag = v2rayConfigCopy.outbounds[0].tag;
|
||||||
|
rule.type = "field";
|
||||||
|
v2rayConfig.routing.rules.Add(rule);
|
||||||
|
}
|
||||||
|
|
||||||
|
Utils.ToJsonFile(v2rayConfig, fileName);
|
||||||
|
|
||||||
|
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
msg = UIRes.I18N("FailedGenDefaultConfiguration");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,27 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 载入V2ray
|
||||||
|
/// </summary>
|
||||||
|
public void LoadV2ray(Config config, List<int> _selecteds)
|
||||||
|
{
|
||||||
|
if (Global.reloadV2ray)
|
||||||
|
{
|
||||||
|
string msg = string.Empty;
|
||||||
|
string fileName = Utils.GetPath(v2rayConfigRes);
|
||||||
|
if (V2rayConfigHandler.GenerateClientSpeedtestConfig(config, _selecteds, fileName, out msg) != 0)
|
||||||
|
{
|
||||||
|
ShowMsg(false, msg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowMsg(true, msg);
|
||||||
|
V2rayRestart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// V2ray重启
|
/// V2ray重启
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -23,40 +23,40 @@ namespace v2rayN.HttpProxyHandler
|
||||||
{
|
{
|
||||||
if (type != 0)
|
if (type != 0)
|
||||||
{
|
{
|
||||||
var port = Global.sysAgentPort;
|
var port = Global.httpPort;
|
||||||
if (port <= 0)
|
if (port <= 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (type == 1)
|
if (type == 1)
|
||||||
{
|
{
|
||||||
PACServerHandle.Stop();
|
//PACServerHandle.Stop();
|
||||||
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}", null);
|
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}", null);
|
||||||
}
|
}
|
||||||
else if (type == 2)
|
else if (type == 2)
|
||||||
{
|
{
|
||||||
string pacUrl = GetPacUrl();
|
string pacUrl = GetPacUrl();
|
||||||
SysProxyHandle.SetIEProxy(true, false, null, pacUrl);
|
SysProxyHandle.SetIEProxy(true, false, null, pacUrl);
|
||||||
PACServerHandle.Stop();
|
//PACServerHandle.Stop();
|
||||||
PACServerHandle.Init(config);
|
PACServerHandle.Init(config);
|
||||||
}
|
}
|
||||||
else if (type == 3)
|
else if (type == 3)
|
||||||
{
|
{
|
||||||
PACServerHandle.Stop();
|
//PACServerHandle.Stop();
|
||||||
SysProxyHandle.SetIEProxy(false, false, null, null);
|
SysProxyHandle.SetIEProxy(false, false, null, null);
|
||||||
}
|
}
|
||||||
else if (type == 4)
|
else if (type == 4)
|
||||||
{
|
{
|
||||||
string pacUrl = GetPacUrl();
|
string pacUrl = GetPacUrl();
|
||||||
SysProxyHandle.SetIEProxy(false, false, null, null);
|
SysProxyHandle.SetIEProxy(false, false, null, null);
|
||||||
PACServerHandle.Stop();
|
//PACServerHandle.Stop();
|
||||||
PACServerHandle.Init(config);
|
PACServerHandle.Init(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SysProxyHandle.SetIEProxy(false, false, null, null);
|
SysProxyHandle.SetIEProxy(false, false, null, null);
|
||||||
PACServerHandle.Stop();
|
//PACServerHandle.Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -74,7 +74,7 @@ namespace v2rayN.HttpProxyHandler
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int localPort = config.GetLocalPort("socks");
|
int localPort = config.GetLocalPort(Global.InboundSocks);
|
||||||
if (localPort > 0)
|
if (localPort > 0)
|
||||||
{
|
{
|
||||||
PrivoxyHandler.Instance.Start(localPort, config);
|
PrivoxyHandler.Instance.Start(localPort, config);
|
||||||
|
@ -82,8 +82,8 @@ namespace v2rayN.HttpProxyHandler
|
||||||
{
|
{
|
||||||
Global.sysAgent = true;
|
Global.sysAgent = true;
|
||||||
Global.socksPort = localPort;
|
Global.socksPort = localPort;
|
||||||
Global.sysAgentPort = PrivoxyHandler.Instance.RunningPort;
|
Global.httpPort = PrivoxyHandler.Instance.RunningPort;
|
||||||
Global.pacPort = Global.sysAgentPort + 1;
|
Global.pacPort = config.GetLocalPort("pac");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,16 +100,11 @@ namespace v2rayN.HttpProxyHandler
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
////开启全局代理则关闭
|
|
||||||
//if (Global.sysAgent)
|
|
||||||
//{
|
|
||||||
PrivoxyHandler.Instance.Stop();
|
PrivoxyHandler.Instance.Stop();
|
||||||
|
|
||||||
Global.sysAgent = false;
|
Global.sysAgent = false;
|
||||||
Global.socksPort = 0;
|
Global.socksPort = 0;
|
||||||
Global.sysAgentPort = 0;
|
Global.httpPort = 0;
|
||||||
Global.pacPort = 0;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -131,7 +126,7 @@ namespace v2rayN.HttpProxyHandler
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int localPort = config.GetLocalPort("socks");
|
int localPort = config.GetLocalPort(Global.InboundSocks);
|
||||||
if (localPort != Global.socksPort)
|
if (localPort != Global.socksPort)
|
||||||
{
|
{
|
||||||
isRestart = true;
|
isRestart = true;
|
||||||
|
|
|
@ -28,14 +28,16 @@ namespace v2rayN.HttpProxyHandler
|
||||||
|
|
||||||
public static void Init(Config config)
|
public static void Init(Config config)
|
||||||
{
|
{
|
||||||
//if (InitServer("*"))
|
Global.pacPort = config.GetLocalPort("pac");
|
||||||
//{
|
|
||||||
// pacPort = Global.pacPort;
|
if (InitServer("*"))
|
||||||
//}
|
|
||||||
if (InitServer(Global.Loopback))
|
|
||||||
{
|
{
|
||||||
pacPort = Global.pacPort;
|
pacPort = Global.pacPort;
|
||||||
}
|
}
|
||||||
|
//else if (InitServer(Global.Loopback))
|
||||||
|
//{
|
||||||
|
// pacPort = Global.pacPort;
|
||||||
|
//}
|
||||||
else if (InitServerB(Global.Loopback))
|
else if (InitServerB(Global.Loopback))
|
||||||
{
|
{
|
||||||
pacPort = Global.pacPort;
|
pacPort = Global.pacPort;
|
||||||
|
@ -67,7 +69,6 @@ namespace v2rayN.HttpProxyHandler
|
||||||
server = new HttpWebServer(SendResponse, prefixes);
|
server = new HttpWebServer(SendResponse, prefixes);
|
||||||
server.Run();
|
server.Run();
|
||||||
|
|
||||||
//pacPort = Global.pacPort;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Utils.SaveLog("Webserver at " + address);
|
Utils.SaveLog("Webserver at " + address);
|
||||||
|
@ -95,7 +96,6 @@ namespace v2rayN.HttpProxyHandler
|
||||||
if (serverB == null)
|
if (serverB == null)
|
||||||
{
|
{
|
||||||
serverB = new HttpWebServerB(Global.pacPort, SendResponse);
|
serverB = new HttpWebServerB(Global.pacPort, SendResponse);
|
||||||
//pacPort = Global.pacPort;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Utils.SaveLog("WebserverB at " + address);
|
Utils.SaveLog("WebserverB at " + address);
|
||||||
|
@ -124,18 +124,23 @@ namespace v2rayN.HttpProxyHandler
|
||||||
|
|
||||||
public static void Stop()
|
public static void Stop()
|
||||||
{
|
{
|
||||||
//try
|
try
|
||||||
//{
|
{
|
||||||
// if (server != null)
|
if (server != null)
|
||||||
// {
|
{
|
||||||
// server.Stop();
|
server.Stop();
|
||||||
// server = null;
|
server = null;
|
||||||
// }
|
}
|
||||||
//}
|
if (serverB != null)
|
||||||
//catch (Exception ex)
|
{
|
||||||
//{
|
serverB.Stop();
|
||||||
// Utils.SaveLog("Webserver Stop " + ex.Message);
|
serverB = null;
|
||||||
//}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog("Webserver Stop " + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
//try
|
//try
|
||||||
//{
|
//{
|
||||||
|
@ -159,7 +164,7 @@ namespace v2rayN.HttpProxyHandler
|
||||||
|
|
||||||
private static string GetPacList(string address)
|
private static string GetPacList(string address)
|
||||||
{
|
{
|
||||||
var port = Global.sysAgentPort;
|
var port = Global.httpPort;
|
||||||
if (port <= 0)
|
if (port <= 0)
|
||||||
{
|
{
|
||||||
return "No port";
|
return "No port";
|
||||||
|
|
|
@ -24,8 +24,6 @@ namespace v2rayN.HttpProxyHandler
|
||||||
private static string _uniqueConfigFile;
|
private static string _uniqueConfigFile;
|
||||||
private static Job _privoxyJob;
|
private static Job _privoxyJob;
|
||||||
private Process _process;
|
private Process _process;
|
||||||
private int _runningPort;
|
|
||||||
private bool _isRunning;
|
|
||||||
|
|
||||||
static PrivoxyHandler()
|
static PrivoxyHandler()
|
||||||
{
|
{
|
||||||
|
@ -36,7 +34,6 @@ namespace v2rayN.HttpProxyHandler
|
||||||
_privoxyJob = new Job();
|
_privoxyJob = new Job();
|
||||||
|
|
||||||
FileManager.UncompressFile(Utils.GetTempPath("v2ray_privoxy.exe"), Resources.privoxy_exe);
|
FileManager.UncompressFile(Utils.GetTempPath("v2ray_privoxy.exe"), Resources.privoxy_exe);
|
||||||
FileManager.UncompressFile(Utils.GetTempPath("mgwz.dll"), Resources.mgwz_dll);
|
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
|
@ -66,18 +63,7 @@ namespace v2rayN.HttpProxyHandler
|
||||||
|
|
||||||
public int RunningPort
|
public int RunningPort
|
||||||
{
|
{
|
||||||
get
|
get; set;
|
||||||
{
|
|
||||||
return _runningPort;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsRunning
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _isRunning;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start(int localPort, Config config)
|
public void Start(int localPort, Config config)
|
||||||
|
@ -90,9 +76,9 @@ namespace v2rayN.HttpProxyHandler
|
||||||
KillProcess(p);
|
KillProcess(p);
|
||||||
}
|
}
|
||||||
string privoxyConfig = Resources.privoxy_conf;
|
string privoxyConfig = Resources.privoxy_conf;
|
||||||
_runningPort = GetFreePort(localPort);
|
RunningPort = config.GetLocalPort(Global.InboundHttp);
|
||||||
privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", localPort.ToString());
|
privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", localPort.ToString());
|
||||||
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", _runningPort.ToString());
|
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", RunningPort.ToString());
|
||||||
if (config.allowLANConn)
|
if (config.allowLANConn)
|
||||||
{
|
{
|
||||||
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", "0.0.0.0");
|
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", "0.0.0.0");
|
||||||
|
@ -123,7 +109,7 @@ namespace v2rayN.HttpProxyHandler
|
||||||
* when ss exit unexpectedly, this process will be forced killed by system.
|
* when ss exit unexpectedly, this process will be forced killed by system.
|
||||||
*/
|
*/
|
||||||
_privoxyJob.AddProcess(_process.Handle);
|
_privoxyJob.AddProcess(_process.Handle);
|
||||||
_isRunning = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +120,7 @@ namespace v2rayN.HttpProxyHandler
|
||||||
KillProcess(_process);
|
KillProcess(_process);
|
||||||
_process.Dispose();
|
_process.Dispose();
|
||||||
_process = null;
|
_process = null;
|
||||||
_isRunning = false;
|
RunningPort = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,25 +177,5 @@ namespace v2rayN.HttpProxyHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int GetFreePort(int localPort)
|
|
||||||
{
|
|
||||||
int defaultPort = 8123;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//// TCP stack please do me a favor
|
|
||||||
//TcpListener l = new TcpListener(IPAddress.Loopback, 0);
|
|
||||||
//l.Start();
|
|
||||||
//var port = ((IPEndPoint)l.LocalEndpoint).Port;
|
|
||||||
//l.Stop();
|
|
||||||
//return port;
|
|
||||||
return localPort + 1;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
// in case access denied
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
return defaultPort;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,93 +13,147 @@ namespace v2rayN.Mode
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 本地监听
|
/// 本地监听
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<InItem> inbound { get; set; }
|
public List<InItem> inbound
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 允许日志
|
/// 允许日志
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool logEnabled { get; set; }
|
public bool logEnabled
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 日志等级
|
/// 日志等级
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string loglevel { get; set; }
|
public string loglevel
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 活动配置序号
|
/// 活动配置序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int index { get; set; }
|
public int index
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// vmess服务器信息
|
/// vmess服务器信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<VmessItem> vmess { get; set; }
|
public List<VmessItem> vmess
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 允许Mux多路复用
|
/// 允许Mux多路复用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool muxEnabled { get; set; }
|
public bool muxEnabled
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 域名解析策略
|
/// 域名解析策略
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string domainStrategy { get; set; }
|
public string domainStrategy
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 路由模式
|
/// 路由模式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string routingMode { get; set; }
|
public string routingMode
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户自定义需代理的网址或ip
|
/// 用户自定义需代理的网址或ip
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> useragent { get; set; }
|
public List<string> useragent
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户自定义直连的网址或ip
|
/// 用户自定义直连的网址或ip
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> userdirect { get; set; }
|
public List<string> userdirect
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户自定义阻止的网址或ip
|
/// 用户自定义阻止的网址或ip
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> userblock { get; set; }
|
public List<string> userblock
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// KcpItem
|
/// KcpItem
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public KcpItem kcpItem { get; set; }
|
public KcpItem kcpItem
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 启用Http代理
|
/// 启用Http代理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool sysAgentEnabled { get; set; }
|
public bool sysAgentEnabled
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 监听状态 0-不改变 1-全局 2-PAC
|
/// 监听状态 0-不改变 1-全局 2-PAC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int listenerType { get; set; }
|
public int listenerType
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义GFWList url
|
/// 自定义GFWList url
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string urlGFWList { get; set; }
|
public string urlGFWList
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 允许来自局域网的连接
|
/// 允许来自局域网的连接
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool allowLANConn { get; set; }
|
public bool allowLANConn
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 启用实时网速和流量统计
|
/// 启用实时网速和流量统计
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool enableStatistics { get; set; }
|
public bool enableStatistics
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 视图刷新率
|
/// 视图刷新率
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int statisticsFreshRate { get; set; }
|
public int statisticsFreshRate
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 统计数据缓存天数 [0, 30]
|
/// 统计数据缓存天数 [0, 30]
|
||||||
|
@ -107,8 +161,12 @@ namespace v2rayN.Mode
|
||||||
/// * 无论如何不会关闭总流量的缓存
|
/// * 无论如何不会关闭总流量的缓存
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private uint cacheDays;
|
private uint cacheDays;
|
||||||
public uint CacheDays {
|
public uint CacheDays
|
||||||
get { return cacheDays; }
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return cacheDays;
|
||||||
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value < 0) cacheDays = 0;
|
if (value < 0) cacheDays = 0;
|
||||||
|
@ -120,15 +178,24 @@ namespace v2rayN.Mode
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义远程DNS
|
/// 自定义远程DNS
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string remoteDNS { get; set; }
|
public string remoteDNS
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订阅
|
/// 订阅
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<SubItem> subItem { get; set; }
|
public List<SubItem> subItem
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// UI
|
/// UI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public UIItem uiItem { get; set; }
|
public UIItem uiItem
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
#region 函数
|
#region 函数
|
||||||
|
|
||||||
|
@ -236,6 +303,19 @@ namespace v2rayN.Mode
|
||||||
|
|
||||||
public int GetLocalPort(string protocol)
|
public int GetLocalPort(string protocol)
|
||||||
{
|
{
|
||||||
|
if (protocol == Global.InboundHttp)
|
||||||
|
{
|
||||||
|
return GetLocalPort(Global.InboundSocks) + 1;
|
||||||
|
}
|
||||||
|
else if (protocol == "pac")
|
||||||
|
{
|
||||||
|
return GetLocalPort(Global.InboundSocks) + 2;
|
||||||
|
}
|
||||||
|
else if (protocol == "speedtest")
|
||||||
|
{
|
||||||
|
return GetLocalPort(Global.InboundSocks) + 103;
|
||||||
|
}
|
||||||
|
|
||||||
int localPort = 0;
|
int localPort = 0;
|
||||||
foreach (InItem inItem in inbound)
|
foreach (InItem inItem in inbound)
|
||||||
{
|
{
|
||||||
|
@ -352,77 +432,125 @@ namespace v2rayN.Mode
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 版本(现在=2)
|
/// 版本(现在=2)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int configVersion { get; set; }
|
public int configVersion
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器地址
|
/// 远程服务器地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string address { get; set; }
|
public string address
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器端口
|
/// 远程服务器端口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int port { get; set; }
|
public int port
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器ID
|
/// 远程服务器ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string id { get; set; }
|
public string id
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器额外ID
|
/// 远程服务器额外ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int alterId { get; set; }
|
public int alterId
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 本地安全策略
|
/// 本地安全策略
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string security { get; set; }
|
public string security
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// tcp,kcp,ws
|
/// tcp,kcp,ws
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string network { get; set; }
|
public string network
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注或别名
|
/// 备注或别名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string remarks { get; set; }
|
public string remarks
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 伪装类型
|
/// 伪装类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string headerType { get; set; }
|
public string headerType
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 伪装的域名
|
/// 伪装的域名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string requestHost { get; set; }
|
public string requestHost
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ws h2 path
|
/// ws h2 path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string path { get; set; }
|
public string path
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 底层传输安全
|
/// 底层传输安全
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string streamSecurity { get; set; }
|
public string streamSecurity
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否允许不安全连接(用于客户端)
|
/// 是否允许不安全连接(用于客户端)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string allowInsecure { get; set; }
|
public string allowInsecure
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// config type(1=normal,2=custom)
|
/// config type(1=normal,2=custom)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int configType { get; set; }
|
public int configType
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string testResult { get; set; }
|
public string testResult
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SubItem id
|
/// SubItem id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string subid { get; set; }
|
public string subid
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
@ -431,17 +559,26 @@ namespace v2rayN.Mode
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 本地监听端口
|
/// 本地监听端口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int localPort { get; set; }
|
public int localPort
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 协议,默认为socks
|
/// 协议,默认为socks
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string protocol { get; set; }
|
public string protocol
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 允许udp
|
/// 允许udp
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool udpEnabled { get; set; }
|
public bool udpEnabled
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开启流量探测
|
/// 开启流量探测
|
||||||
|
@ -455,31 +592,52 @@ namespace v2rayN.Mode
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int mtu { get; set; }
|
public int mtu
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int tti { get; set; }
|
public int tti
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int uplinkCapacity { get; set; }
|
public int uplinkCapacity
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int downlinkCapacity { get; set; }
|
public int downlinkCapacity
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool congestion { get; set; }
|
public bool congestion
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int readBufferSize { get; set; }
|
public int readBufferSize
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int writeBufferSize { get; set; }
|
public int writeBufferSize
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -489,17 +647,26 @@ namespace v2rayN.Mode
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string id { get; set; }
|
public string id
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string remarks { get; set; }
|
public string remarks
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// url
|
/// url
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string url { get; set; }
|
public string url
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// enable
|
/// enable
|
||||||
|
|
|
@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
|
||||||
// 方法是按如下所示使用“*”:
|
// 方法是按如下所示使用“*”:
|
||||||
//[assembly: AssemblyVersion("1.0.*")]
|
//[assembly: AssemblyVersion("1.0.*")]
|
||||||
//[assembly: AssemblyVersion("1.0.0")]
|
//[assembly: AssemblyVersion("1.0.0")]
|
||||||
[assembly: AssemblyFileVersion("2.45")]
|
[assembly: AssemblyFileVersion("2.47")]
|
||||||
|
|
25
v2rayN/v2rayN/Properties/Resources.Designer.cs
generated
25
v2rayN/v2rayN/Properties/Resources.Designer.cs
generated
|
@ -19,7 +19,7 @@ namespace v2rayN.Properties {
|
||||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
// (以 /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.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources {
|
||||||
|
@ -91,25 +91,35 @@ namespace v2rayN.Properties {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
/// 查找 System.Byte[] 类型的本地化资源。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Bitmap help {
|
internal static byte[] grpc_csharp_ext_x64_dll {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("help", resourceCulture);
|
object obj = ResourceManager.GetObject("grpc_csharp_ext_x64_dll", resourceCulture);
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
return ((byte[])(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找 System.Byte[] 类型的本地化资源。
|
/// 查找 System.Byte[] 类型的本地化资源。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static byte[] mgwz_dll {
|
internal static byte[] grpc_csharp_ext_x86_dll {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("mgwz_dll", resourceCulture);
|
object obj = ResourceManager.GetObject("grpc_csharp_ext_x86_dll", resourceCulture);
|
||||||
return ((byte[])(obj));
|
return ((byte[])(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap help {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("help", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -157,6 +167,7 @@ namespace v2rayN.Properties {
|
||||||
///show-on-task-bar 0
|
///show-on-task-bar 0
|
||||||
///activity-animation 0
|
///activity-animation 0
|
||||||
///forward-socks5 / 127.0.0.1:__SOCKS_PORT__ .
|
///forward-socks5 / 127.0.0.1:__SOCKS_PORT__ .
|
||||||
|
///max-client-connections 2048
|
||||||
///hide-console
|
///hide-console
|
||||||
/// 的本地化字符串。
|
/// 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -127,12 +127,15 @@
|
||||||
<data name="checkupdate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="checkupdate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\checkupdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\resources\checkupdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="grpc_csharp_ext_x64_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\resources\grpc_csharp_ext.x64.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name="grpc_csharp_ext_x86_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\resources\grpc_csharp_ext.x86.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
<data name="help" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="help" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="mgwz_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\resources\mgwz.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</data>
|
|
||||||
<data name="minimize" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<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>
|
<value>..\Resources\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
BIN
v2rayN/v2rayN/Resources/grpc_csharp_ext.x64.dll.gz
Normal file
BIN
v2rayN/v2rayN/Resources/grpc_csharp_ext.x64.dll.gz
Normal file
Binary file not shown.
BIN
v2rayN/v2rayN/Resources/grpc_csharp_ext.x86.dll.gz
Normal file
BIN
v2rayN/v2rayN/Resources/grpc_csharp_ext.x86.dll.gz
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -198,6 +198,11 @@
|
||||||
<Compile Include="Mode\ServerStatistics.cs" />
|
<Compile Include="Mode\ServerStatistics.cs" />
|
||||||
<Compile Include="Mode\SysproxyConfig.cs" />
|
<Compile Include="Mode\SysproxyConfig.cs" />
|
||||||
<Compile Include="Mode\EConfigType.cs" />
|
<Compile Include="Mode\EConfigType.cs" />
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Resx\ResUI.zh-Hans.Designer.cs">
|
<Compile Include="Resx\ResUI.zh-Hans.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
|
@ -319,14 +324,9 @@
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
</Compile>
|
|
||||||
<EmbeddedResource Include="app.config">
|
<EmbeddedResource Include="app.config">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
@ -342,6 +342,8 @@
|
||||||
</Compile>
|
</Compile>
|
||||||
<Protobuf Include="Protos\Statistics.proto" />
|
<Protobuf Include="Protos\Statistics.proto" />
|
||||||
<None Include="Resources\abp.js.gz" />
|
<None Include="Resources\abp.js.gz" />
|
||||||
|
<None Include="Resources\grpc_csharp_ext.x64.dll.gz" />
|
||||||
|
<None Include="Resources\grpc_csharp_ext.x86.dll.gz" />
|
||||||
<None Include="Resources\pac.txt.gz" />
|
<None Include="Resources\pac.txt.gz" />
|
||||||
<None Include="Resources\sysproxy.exe.gz" />
|
<None Include="Resources\sysproxy.exe.gz" />
|
||||||
<None Include="Resources\sysproxy64.exe.gz" />
|
<None Include="Resources\sysproxy64.exe.gz" />
|
||||||
|
@ -392,7 +394,6 @@
|
||||||
<EmbeddedResource Include="Sample\SampleServerConfig.txt" />
|
<EmbeddedResource Include="Sample\SampleServerConfig.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Resources\mgwz.dll.gz" />
|
|
||||||
<None Include="Resources\privoxy.exe.gz" />
|
<None Include="Resources\privoxy.exe.gz" />
|
||||||
<None Include="Resources\restart.png" />
|
<None Include="Resources\restart.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -420,12 +421,6 @@
|
||||||
<EmbeddedResource Include="LIB\System.Runtime.CompilerServices.Unsafe.dll" />
|
<EmbeddedResource Include="LIB\System.Runtime.CompilerServices.Unsafe.dll" />
|
||||||
<EmbeddedResource Include="LIB\zxing.dll" />
|
<EmbeddedResource Include="LIB\zxing.dll" />
|
||||||
<EmbeddedResource Include="LIB\zxing.presentation.dll" />
|
<EmbeddedResource Include="LIB\zxing.presentation.dll" />
|
||||||
<Content Include="grpc_csharp_ext.x64.dll">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="grpc_csharp_ext.x86.dll">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<EmbeddedResource Include="LIB\netstandard.dll" />
|
<EmbeddedResource Include="LIB\netstandard.dll" />
|
||||||
<Content Include="Resources\help.png" />
|
<Content Include="Resources\help.png" />
|
||||||
<None Include="Resources\notify.png" />
|
<None Include="Resources\notify.png" />
|
||||||
|
|
Loading…
Reference in a new issue