Merge pull request #1 from 2dust/master

21/1/1
This commit is contained in:
icecubi 2021-04-04 09:43:18 +08:00 committed by GitHub
commit bfc15dd164
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
101 changed files with 13220 additions and 13430 deletions

View file

@ -1,101 +0,0 @@
using System;
using System.Net;
using System.Text;
using System.Threading;
namespace v2rayN.Base
{
public class HttpWebServer
{
private HttpListener _listener;
private Func<string, string> _responderMethod;
public HttpWebServer(string[] prefixes, Func<string, string> method)
{
try
{
_listener = new HttpListener();
if (!HttpListener.IsSupported)
throw new NotSupportedException(
"Needs Windows XP SP2, Server 2003 or later.");
// URI prefixes are required, for example
// "http://localhost:8080/index/".
if (prefixes == null || prefixes.Length == 0)
throw new ArgumentException("prefixes");
// A responder method is required
if (method == null)
throw new ArgumentException("method");
foreach (string s in prefixes)
_listener.Prefixes.Add(s);
_responderMethod = method;
_listener.Start();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
throw;
}
}
public HttpWebServer(Func<string, string> method, params string[] prefixes)
: this(prefixes, method) { }
public void Run()
{
ThreadPool.QueueUserWorkItem((o) =>
{
Utils.SaveLog("Webserver running...");
try
{
while (_listener.IsListening)
{
ThreadPool.QueueUserWorkItem((c) =>
{
HttpListenerContext ctx = c as HttpListenerContext;
try
{
string address = ctx.Request.LocalEndPoint.Address.ToString();
Utils.SaveLog("Webserver Request " + address);
string rstr = _responderMethod(address);
byte[] buf = Encoding.UTF8.GetBytes(rstr);
ctx.Response.StatusCode = 200;
ctx.Response.ContentType = "application/x-ns-proxy-autoconfig";
ctx.Response.ContentLength64 = buf.Length;
ctx.Response.OutputStream.Write(buf, 0, buf.Length);
}
catch
{
} // suppress any exceptions
finally
{
// always close the stream
ctx.Response.OutputStream.Close();
}
}, _listener.GetContext());
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
} // suppress any exceptions
});
}
public void Stop()
{
if (_listener != null)
{
_listener.Stop();
_listener.Close();
_listener = null;
}
}
}
}

View file

@ -1,141 +0,0 @@
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace v2rayN.Base
{
public class HttpWebServerB
{
private TcpListener listener;
private int port;
private Func<string, string> _responderMethod;
public HttpWebServerB(int port, Func<string, string> method)
{
this.port = port;
this._responderMethod = method;
Thread thread = new Thread(StartListen)
{
IsBackground = true
};
thread.Start();
}
public void Stop()
{
if (listener != null)
{
listener.Stop();
listener = null;
}
}
private void StartListen()
{
try
{
listener = new TcpListener(IPAddress.Any, port);
listener.Start();
Utils.SaveLog("WebserverB running...");
while (true)
{
if (!listener.Pending())
{
Thread.Sleep(100);
continue;
}
TcpClient socket = listener.AcceptTcpClient();
Thread thread = new Thread(new ParameterizedThreadStart(ProcessThread))
{
IsBackground = true
};
thread.Start(socket);
Thread.Sleep(1);
}
}
catch
{
Utils.SaveLog("WebserverB start fail.");
}
}
private void ProcessThread(object obj)
{
try
{
TcpClient socket = obj as TcpClient;
BufferedStream inputStream = new BufferedStream(socket.GetStream());
StreamWriter outputStream = new StreamWriter(new BufferedStream(socket.GetStream()));
if (inputStream.CanRead)
{
string data = ReadStream(inputStream);
if (data.Contains("/pac/"))
{
if (_responderMethod != null)
{
string address = ((IPEndPoint)socket.Client.LocalEndPoint).Address.ToString();
Utils.SaveLog("WebserverB Request " + address);
string pac = _responderMethod(address);
if (inputStream.CanWrite)
{
WriteStream(outputStream, pac);
}
}
}
}
outputStream.BaseStream.Flush();
inputStream = null;
outputStream = null;
socket.Close();
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
}
private string ReadStream(Stream inputStream)
{
int nextchar;
string data = "";
while (true)
{
nextchar = inputStream.ReadByte();
if (nextchar == '\n')
{
break;
}
if (nextchar == '\r')
{
continue;
}
if (nextchar == -1)
{
Thread.Sleep(1);
continue;
};
data += Convert.ToChar(nextchar);
}
return data;
}
private void WriteStream(StreamWriter outputStream, string pac)
{
string content_type = "application/x-ns-proxy-autoconfig";
outputStream.WriteLine("HTTP/1.1 200 OK");
outputStream.WriteLine(String.Format("Content-Type:{0}", content_type));
outputStream.WriteLine("Connection: close");
outputStream.WriteLine("");
outputStream.WriteLine(pac);
outputStream.Flush();
}
}
}

View file

@ -46,5 +46,7 @@ namespace v2rayN.Base
}
catch { }
}
}
}

View file

@ -55,15 +55,14 @@
//
// btnClose
//
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.label13);
this.groupBox1.Controls.Add(this.cmbSecurity);
this.groupBox1.Controls.Add(this.txtRemarks);
@ -75,6 +74,7 @@
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtAddress);
this.groupBox1.Controls.Add(this.label1);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
@ -85,7 +85,6 @@
//
// cmbSecurity
//
resources.ApplyResources(this.cmbSecurity, "cmbSecurity");
this.cmbSecurity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbSecurity.FormattingEnabled = true;
this.cmbSecurity.Items.AddRange(new object[] {
@ -94,9 +93,8 @@
resources.GetString("cmbSecurity.Items2"),
resources.GetString("cmbSecurity.Items3"),
resources.GetString("cmbSecurity.Items4"),
resources.GetString("cmbSecurity.Items5"),
resources.GetString("cmbSecurity.Items6"),
resources.GetString("cmbSecurity.Items7")});
resources.GetString("cmbSecurity.Items5")});
resources.ApplyResources(this.cmbSecurity, "cmbSecurity");
this.cmbSecurity.Name = "cmbSecurity";
//
// txtRemarks
@ -146,9 +144,9 @@
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// btnOK
@ -165,22 +163,22 @@
//
// menuServer
//
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItem1});
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Name = "menuServer";
//
// MenuItem1
//
resources.ApplyResources(this.MenuItem1, "MenuItem1");
this.MenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuItemImportClipboard});
this.MenuItem1.Name = "MenuItem1";
resources.ApplyResources(this.MenuItem1, "MenuItem1");
//
// menuItemImportClipboard
//
resources.ApplyResources(this.menuItemImportClipboard, "menuItemImportClipboard");
this.menuItemImportClipboard.Name = "menuItemImportClipboard";
resources.ApplyResources(this.menuItemImportClipboard, "menuItemImportClipboard");
this.menuItemImportClipboard.Click += new System.EventHandler(this.menuItemImportClipboard_Click);
//
// AddServer3Form

View file

@ -119,7 +119,7 @@ namespace v2rayN.Forms
{
ClearServer();
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
VmessItem vmessItem = ShareHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.ShowWarning(msg);

View file

@ -118,489 +118,483 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 17</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
<value>337, 158</value>
</data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
<data name="label13.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
<data name="label13.Text" xml:space="preserve">
<value>* Fill in manually</value>
</data>
<data name="&gt;&gt;cmbSecurity.Parent" xml:space="preserve">
<value>groupBox1</value>
<data name="&gt;&gt;label13.Name" xml:space="preserve">
<value>label13</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label5.Type" xml:space="preserve">
<data name="&gt;&gt;label13.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 25</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;menuServer.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label13.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label5.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>Import configuration file</value>
</data>
<data name="&gt;&gt;txtPort.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Password</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuItemImportClipboard.Name" xml:space="preserve">
<value>menuItemImportClipboard</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="menuServer.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 27</value>
</data>
<data name="&gt;&gt;menuServer.Type" xml:space="preserve">
<value>System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="cmbSecurity.Items" xml:space="preserve">
<value>aes-256-cfb</value>
<value>aes-256-gcm</value>
</data>
<data name="cmbSecurity.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
<data name="cmbSecurity.Items1" xml:space="preserve">
<value>aes-128-gcm</value>
</data>
<data name="txtId.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
<data name="cmbSecurity.Items2" xml:space="preserve">
<value>chacha20-poly1305</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value>
<data name="cmbSecurity.Items3" xml:space="preserve">
<value>chacha20-ietf-poly1305</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="cmbSecurity.Items4" xml:space="preserve">
<value>none</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;MenuItem1.Name" xml:space="preserve">
<value>MenuItem1</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="&gt;&gt;txtAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 17</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="menuServer.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 60</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 25</value>
</data>
<data name="label5.Text" xml:space="preserve">
<value>Encryption</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label13.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>162, 21</value>
<data name="cmbSecurity.Items5" xml:space="preserve">
<value>plain</value>
</data>
<data name="cmbSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 123</value>
</data>
<data name="txtId.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 91</value>
<data name="cmbSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 20</value>
</data>
<data name="&gt;&gt;label5.Parent" xml:space="preserve">
<data name="cmbSecurity.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;cmbSecurity.Name" xml:space="preserve">
<value>cmbSecurity</value>
</data>
<data name="&gt;&gt;cmbSecurity.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbSecurity.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
<data name="&gt;&gt;cmbSecurity.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 154</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 155</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>Alias (remarks)</value>
</data>
<data name="&gt;&gt;txtId.Parent" xml:space="preserve">
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 124</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label5.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="label5.Text" xml:space="preserve">
<value>Encryption</value>
</data>
<data name="&gt;&gt;label5.Name" xml:space="preserve">
<value>label5</value>
</data>
<data name="&gt;&gt;label5.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label5.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="txtId.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 91</value>
</data>
<data name="txtId.PasswordChar" type="System.Char, mscorlib" xml:space="preserve">
<value>*</value>
</data>
<data name="txtId.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 21</value>
</data>
<data name="txtId.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;txtId.Name" xml:space="preserve">
<value>txtId</value>
</data>
<data name="&gt;&gt;txtId.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 31</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<data name="&gt;&gt;txtId.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>AddServer3Form</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 59</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="&gt;&gt;MenuItem1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 124</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</value>
</data>
<data name="cmbSecurity.Items1" xml:space="preserve">
<value>aes-128-cfb</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 10</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 35</value>
</data>
<data name="&gt;&gt;txtId.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="menuItemImportClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>235, 22</value>
</data>
<data name="&gt;&gt;menuItemImportClipboard.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Edit or add a [Shadowsocks] server</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="cmbSecurity.Items2" xml:space="preserve">
<value>chacha20</value>
</data>
<data name="&gt;&gt;cmbSecurity.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;menuServer.ZOrder" xml:space="preserve">
<value>3</value>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 93</value>
</data>
<data name="cmbSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 20</value>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="cmbSecurity.Items3" xml:space="preserve">
<value>chacha20-ietf</value>
<data name="label3.Text" xml:space="preserve">
<value>Password</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;label13.Type" xml:space="preserve">
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 59</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</value>
</data>
<data name="&gt;&gt;txtPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtPort.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 62</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Server port</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 27</value>
</data>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="txtAddress.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="&gt;&gt;txtAddress.Name" xml:space="preserve">
<value>txtAddress</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
<data name="&gt;&gt;txtAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
<data name="&gt;&gt;txtAddress.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
<data name="&gt;&gt;txtAddress.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="&gt;&gt;label13.Name" xml:space="preserve">
<value>label13</value>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cmbSecurity.Items4" xml:space="preserve">
<value>aes-256-gcm</value>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 31</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Server address</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Server port</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 231</value>
</data>
<data name="&gt;&gt;txtAddress.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="cmbSecurity.Items5" xml:space="preserve">
<value>aes-128-gcm</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Server address</value>
</data>
<data name="&gt;&gt;menuServer.Name" xml:space="preserve">
<value>menuServer</value>
</data>
<data name="&gt;&gt;txtAddress.Name" xml:space="preserve">
<value>txtAddress</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 154</value>
</data>
<data name="cmbSecurity.Items6" xml:space="preserve">
<value>chacha20-poly1305</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>* Fill in manually</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 62</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>547, 291</value>
</data>
<data name="cmbSecurity.Items7" xml:space="preserve">
<value>chacha20-ietf-poly1305</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;cmbSecurity.Name" xml:space="preserve">
<value>cmbSecurity</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 35</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 196</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
<value>337, 158</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;cmbSecurity.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtId.PasswordChar" type="System.Char, mscorlib" xml:space="preserve">
<value>*</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="menuItemImportClipboard.Text" xml:space="preserve">
<value>Import URL from clipboard</value>
</data>
<data name="&gt;&gt;txtAddress.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 155</value>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="txtId.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 21</value>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 231</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 25</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 10</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<metadata name="menuServer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="menuItemImportClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>235, 22</value>
</data>
<data name="menuItemImportClipboard.Text" xml:space="preserve">
<value>Import URL from clipboard</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>162, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>Import configuration file</value>
</data>
<data name="menuServer.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 25</value>
</data>
<data name="menuServer.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;menuServer.Name" xml:space="preserve">
<value>menuServer</value>
</data>
<data name="&gt;&gt;menuServer.Type" xml:space="preserve">
<value>System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuServer.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;menuServer.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="menuServer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>547, 291</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Edit or add a [Shadowsocks] server</value>
</data>
<data name="&gt;&gt;MenuItem1.Name" xml:space="preserve">
<value>MenuItem1</value>
</data>
<data name="&gt;&gt;MenuItem1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuItemImportClipboard.Name" xml:space="preserve">
<value>menuItemImportClipboard</value>
</data>
<data name="&gt;&gt;menuItemImportClipboard.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>AddServer3Form</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseServerForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View file

@ -108,7 +108,7 @@ namespace v2rayN.Forms
{
ClearServer();
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
VmessItem vmessItem = ShareHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.ShowWarning(msg);

View file

@ -39,6 +39,8 @@
this.label24 = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.panTlsMore = new System.Windows.Forms.Panel();
this.txtSNI = new System.Windows.Forms.TextBox();
this.label22 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.cmbAllowInsecure = new System.Windows.Forms.ComboBox();
this.label9 = new System.Windows.Forms.Label();
@ -78,6 +80,7 @@
this.MenuItemImportServer = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.MenuItemImportClipboard = new System.Windows.Forms.ToolStripMenuItem();
this.label25 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.panTlsMore.SuspendLayout();
@ -146,6 +149,7 @@
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label25);
this.groupBox2.Controls.Add(this.label24);
this.groupBox2.Controls.Add(this.label23);
this.groupBox2.Controls.Add(this.panTlsMore);
@ -182,11 +186,23 @@
//
// panTlsMore
//
this.panTlsMore.Controls.Add(this.txtSNI);
this.panTlsMore.Controls.Add(this.label22);
this.panTlsMore.Controls.Add(this.label21);
this.panTlsMore.Controls.Add(this.cmbAllowInsecure);
resources.ApplyResources(this.panTlsMore, "panTlsMore");
this.panTlsMore.Name = "panTlsMore";
//
// txtSNI
//
resources.ApplyResources(this.txtSNI, "txtSNI");
this.txtSNI.Name = "txtSNI";
//
// label22
//
resources.ApplyResources(this.label22, "label22");
this.label22.Name = "label22";
//
// label21
//
resources.ApplyResources(this.label21, "label21");
@ -227,7 +243,8 @@
resources.GetString("cmbNetwork.Items1"),
resources.GetString("cmbNetwork.Items2"),
resources.GetString("cmbNetwork.Items3"),
resources.GetString("cmbNetwork.Items4")});
resources.GetString("cmbNetwork.Items4"),
resources.GetString("cmbNetwork.Items5")});
resources.ApplyResources(this.cmbNetwork, "cmbNetwork");
this.cmbNetwork.Name = "cmbNetwork";
this.cmbNetwork.SelectedIndexChanged += new System.EventHandler(this.cmbNetwork_SelectedIndexChanged);
@ -432,6 +449,11 @@
resources.ApplyResources(this.MenuItemImportClipboard, "MenuItemImportClipboard");
this.MenuItemImportClipboard.Click += new System.EventHandler(this.MenuItemImportClipboard_Click);
//
// label25
//
resources.ApplyResources(this.label25, "label25");
this.label25.Name = "label25";
//
// AddServer5Form
//
resources.ApplyResources(this, "$this");
@ -509,5 +531,8 @@
private System.Windows.Forms.Label label23;
private System.Windows.Forms.ComboBox cmbFlow;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtSNI;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.Label label25;
}
}

View file

@ -45,6 +45,7 @@ namespace v2rayN.Forms
txtPath.Text = vmessItem.path;
cmbStreamSecurity.Text = vmessItem.streamSecurity;
cmbAllowInsecure.Text = vmessItem.allowInsecure;
txtSNI.Text = vmessItem.sni;
}
@ -66,6 +67,7 @@ namespace v2rayN.Forms
cmbStreamSecurity.Text = "";
cmbAllowInsecure.Text = "";
txtPath.Text = "";
txtSNI.Text = "";
}
@ -122,6 +124,7 @@ namespace v2rayN.Forms
string path = txtPath.Text;
string streamSecurity = cmbStreamSecurity.Text;
string allowInsecure = cmbAllowInsecure.Text;
string sni = txtSNI.Text;
if (Utils.IsNullOrEmpty(address))
{
@ -153,6 +156,7 @@ namespace v2rayN.Forms
vmessItem.path = path.Replace(" ", "");
vmessItem.streamSecurity = streamSecurity;
vmessItem.allowInsecure = allowInsecure;
vmessItem.sni = sni;
if (ConfigHandler.AddVlessServer(ref config, vmessItem, EditIndex) == 0)
{
@ -263,7 +267,7 @@ namespace v2rayN.Forms
{
ClearServer();
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
VmessItem vmessItem = ShareHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.ShowWarning(msg);

View file

@ -261,6 +261,36 @@
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label25.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label25.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label25.Location" type="System.Drawing.Point, System.Drawing">
<value>529, 210</value>
</data>
<data name="label25.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
<data name="label25.TabIndex" type="System.Int32, mscorlib">
<value>37</value>
</data>
<data name="label25.Text" xml:space="preserve">
<value>4)grpc serviceName</value>
</data>
<data name="&gt;&gt;label25.Name" xml:space="preserve">
<value>label25</value>
</data>
<data name="&gt;&gt;label25.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label25.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label25.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label24.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@ -268,7 +298,7 @@
<value>NoControl</value>
</data>
<data name="label24.Location" type="System.Drawing.Point, System.Drawing">
<value>529, 207</value>
<value>529, 197</value>
</data>
<data name="label24.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 12</value>
@ -289,7 +319,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label24.ZOrder" xml:space="preserve">
<value>0</value>
<value>1</value>
</data>
<data name="label23.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -319,6 +349,57 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label23.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="txtSNI.Location" type="System.Drawing.Point, System.Drawing">
<value>297, 7</value>
</data>
<data name="txtSNI.Size" type="System.Drawing.Size, System.Drawing">
<value>200, 21</value>
</data>
<data name="txtSNI.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<data name="&gt;&gt;txtSNI.Name" xml:space="preserve">
<value>txtSNI</value>
</data>
<data name="&gt;&gt;txtSNI.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtSNI.Parent" xml:space="preserve">
<value>panTlsMore</value>
</data>
<data name="&gt;&gt;txtSNI.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label22.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label22.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label22.Location" type="System.Drawing.Point, System.Drawing">
<value>267, 11</value>
</data>
<data name="label22.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 12</value>
</data>
<data name="label22.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="label22.Text" xml:space="preserve">
<value>SNI</value>
</data>
<data name="&gt;&gt;label22.Name" xml:space="preserve">
<value>label22</value>
</data>
<data name="&gt;&gt;label22.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label22.Parent" xml:space="preserve">
<value>panTlsMore</value>
</data>
<data name="&gt;&gt;label22.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label21.AutoSize" type="System.Boolean, mscorlib">
@ -349,7 +430,7 @@
<value>panTlsMore</value>
</data>
<data name="&gt;&gt;label21.ZOrder" xml:space="preserve">
<value>0</value>
<value>2</value>
</data>
<data name="cmbAllowInsecure.Items" xml:space="preserve">
<value />
@ -361,10 +442,10 @@
<value>false</value>
</data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>107, 7</value>
<value>100, 7</value>
</data>
<data name="cmbAllowInsecure.Size" type="System.Drawing.Size, System.Drawing">
<value>91, 20</value>
<value>80, 20</value>
</data>
<data name="cmbAllowInsecure.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
@ -379,13 +460,13 @@
<value>panTlsMore</value>
</data>
<data name="&gt;&gt;cmbAllowInsecure.ZOrder" xml:space="preserve">
<value>1</value>
<value>3</value>
</data>
<data name="panTlsMore.Location" type="System.Drawing.Point, System.Drawing">
<value>284, 232</value>
<value>200, 232</value>
</data>
<data name="panTlsMore.Size" type="System.Drawing.Size, System.Drawing">
<value>338, 35</value>
<value>500, 35</value>
</data>
<data name="panTlsMore.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
@ -400,7 +481,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;panTlsMore.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="label9.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -427,7 +508,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label9.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="label20.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -454,7 +535,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label20.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="txtPath.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 169</value>
@ -478,7 +559,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;txtPath.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="cmbNetwork.Items" xml:space="preserve">
<value>tcp</value>
@ -495,6 +576,9 @@
<data name="cmbNetwork.Items4" xml:space="preserve">
<value>quic</value>
</data>
<data name="cmbNetwork.Items5" xml:space="preserve">
<value>grpc</value>
</data>
<data name="cmbNetwork.Location" type="System.Drawing.Point, System.Drawing">
<value>192, 28</value>
</data>
@ -514,7 +598,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;cmbNetwork.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="label7.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -541,7 +625,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label7.ZOrder" xml:space="preserve">
<value>7</value>
<value>8</value>
</data>
<data name="label19.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -568,13 +652,13 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label19.ZOrder" xml:space="preserve">
<value>8</value>
<value>9</value>
</data>
<data name="label18.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label18.Location" type="System.Drawing.Point, System.Drawing">
<value>529, 189</value>
<value>529, 183</value>
</data>
<data name="label18.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 12</value>
@ -595,7 +679,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label18.ZOrder" xml:space="preserve">
<value>9</value>
<value>10</value>
</data>
<data name="label17.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -622,13 +706,13 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label17.ZOrder" xml:space="preserve">
<value>10</value>
<value>11</value>
</data>
<data name="label16.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label16.Location" type="System.Drawing.Point, System.Drawing">
<value>529, 172</value>
<value>529, 169</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 12</value>
@ -649,7 +733,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label16.ZOrder" xml:space="preserve">
<value>11</value>
<value>12</value>
</data>
<data name="label14.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -676,7 +760,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label14.ZOrder" xml:space="preserve">
<value>12</value>
<value>13</value>
</data>
<data name="label15.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -703,7 +787,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label15.ZOrder" xml:space="preserve">
<value>13</value>
<value>14</value>
</data>
<data name="cmbStreamSecurity.Items" xml:space="preserve">
<value />
@ -718,7 +802,7 @@
<value>127, 239</value>
</data>
<data name="cmbStreamSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>143, 20</value>
<value>60, 20</value>
</data>
<data name="cmbStreamSecurity.TabIndex" type="System.Int32, mscorlib">
<value>21</value>
@ -733,7 +817,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;cmbStreamSecurity.ZOrder" xml:space="preserve">
<value>14</value>
<value>15</value>
</data>
<data name="label12.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -760,7 +844,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>15</value>
<value>16</value>
</data>
<data name="txtRequestHost.Location" type="System.Drawing.Point, System.Drawing">
<value>158, 100</value>
@ -784,7 +868,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;txtRequestHost.ZOrder" xml:space="preserve">
<value>16</value>
<value>17</value>
</data>
<data name="label11.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -811,7 +895,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label11.ZOrder" xml:space="preserve">
<value>17</value>
<value>18</value>
</data>
<data name="label10.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -838,7 +922,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label10.ZOrder" xml:space="preserve">
<value>18</value>
<value>19</value>
</data>
<data name="cmbHeaderType.Items" xml:space="preserve">
<value>none</value>
@ -880,7 +964,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;cmbHeaderType.ZOrder" xml:space="preserve">
<value>19</value>
<value>20</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>

View file

@ -120,9 +120,6 @@
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cmbFlow.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 20</value>
@ -139,9 +136,6 @@
<data name="label13.Text" xml:space="preserve">
<value>*手填,方便识别管理</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>底层传输方式(transport)</value>
</data>
<data name="label24.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 12</value>
</data>
@ -161,7 +155,7 @@
<value>跳过证书验证(allowInsecure)</value>
</data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>223, 7</value>
<value>181, 7</value>
</data>
<data name="label9.Location" type="System.Drawing.Point, System.Drawing">
<value>353, 36</value>
@ -259,6 +253,9 @@
<data name="cmbHeaderType.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 67</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>底层传输方式(transport)</value>
</data>
<data name="label8.Location" type="System.Drawing.Point, System.Drawing">
<value>353, 158</value>
</data>
@ -304,19 +301,12 @@
<data name="label1.Text" xml:space="preserve">
<value>地址(address)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="MenuItem1.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>92, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>导入配置文件</value>
</data>
<data name="MenuItemImportClient.Size" type="System.Drawing.Size, System.Drawing">
<value>171, 22</value>
</data>
@ -338,6 +328,16 @@
<data name="MenuItemImportClipboard.Text" xml:space="preserve">
<value>从剪贴板导入URL</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="MenuItem1.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>92, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>导入配置文件</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>编辑或添加[VLESS]服务器</value>
</data>

View file

@ -31,6 +31,12 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddServer6Form));
this.btnClose = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label21 = new System.Windows.Forms.Label();
this.cmbAllowInsecure = new System.Windows.Forms.ComboBox();
this.label15 = new System.Windows.Forms.Label();
this.cmbStreamSecurity = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.txtSNI = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
@ -58,6 +64,12 @@
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.label21);
this.groupBox1.Controls.Add(this.cmbAllowInsecure);
this.groupBox1.Controls.Add(this.label15);
this.groupBox1.Controls.Add(this.cmbStreamSecurity);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.txtSNI);
this.groupBox1.Controls.Add(this.label13);
this.groupBox1.Controls.Add(this.txtRemarks);
this.groupBox1.Controls.Add(this.label6);
@ -70,6 +82,47 @@
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// label21
//
resources.ApplyResources(this.label21, "label21");
this.label21.Name = "label21";
//
// cmbAllowInsecure
//
resources.ApplyResources(this.cmbAllowInsecure, "cmbAllowInsecure");
this.cmbAllowInsecure.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbAllowInsecure.FormattingEnabled = true;
this.cmbAllowInsecure.Items.AddRange(new object[] {
resources.GetString("cmbAllowInsecure.Items"),
resources.GetString("cmbAllowInsecure.Items1"),
resources.GetString("cmbAllowInsecure.Items2")});
this.cmbAllowInsecure.Name = "cmbAllowInsecure";
//
// label15
//
resources.ApplyResources(this.label15, "label15");
this.label15.Name = "label15";
//
// cmbStreamSecurity
//
resources.ApplyResources(this.cmbStreamSecurity, "cmbStreamSecurity");
this.cmbStreamSecurity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbStreamSecurity.FormattingEnabled = true;
this.cmbStreamSecurity.Items.AddRange(new object[] {
resources.GetString("cmbStreamSecurity.Items"),
resources.GetString("cmbStreamSecurity.Items1")});
this.cmbStreamSecurity.Name = "cmbStreamSecurity";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// txtSNI
//
resources.ApplyResources(this.txtSNI, "txtSNI");
this.txtSNI.Name = "txtSNI";
//
// label13
//
resources.ApplyResources(this.label13, "label13");
@ -169,5 +222,11 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtSNI;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.ComboBox cmbStreamSecurity;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.ComboBox cmbAllowInsecure;
}
}

View file

@ -35,7 +35,10 @@ namespace v2rayN.Forms
txtAddress.Text = vmessItem.address;
txtPort.Text = vmessItem.port.ToString();
txtId.Text = vmessItem.id;
txtSNI.Text = vmessItem.sni;
txtRemarks.Text = vmessItem.remarks;
cmbStreamSecurity.Text = vmessItem.streamSecurity;
cmbAllowInsecure.Text = vmessItem.allowInsecure;
}
@ -47,7 +50,10 @@ namespace v2rayN.Forms
txtAddress.Text = "";
txtPort.Text = "";
txtId.Text = "";
txtSNI.Text = "";
txtRemarks.Text = "";
cmbStreamSecurity.Text = "tls";
cmbAllowInsecure.Text = "";
}
private void btnOK_Click(object sender, EventArgs e)
@ -55,7 +61,10 @@ namespace v2rayN.Forms
string address = txtAddress.Text;
string port = txtPort.Text;
string id = txtId.Text;
string sni = txtSNI.Text;
string remarks = txtRemarks.Text;
string streamSecurity = cmbStreamSecurity.Text;
string allowInsecure = cmbAllowInsecure.Text;
if (Utils.IsNullOrEmpty(address))
{
@ -76,7 +85,10 @@ namespace v2rayN.Forms
vmessItem.address = address;
vmessItem.port = Utils.ToInt(port);
vmessItem.id = id;
vmessItem.sni = sni.Replace(" ", "");
vmessItem.remarks = remarks;
vmessItem.streamSecurity = streamSecurity;
vmessItem.allowInsecure = allowInsecure;
if (ConfigHandler.AddTrojanServer(ref config, vmessItem, EditIndex) == 0)
{

View file

@ -117,101 +117,332 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="&gt;&gt;txtPort.Parent" xml:space="preserve">
<value>groupBox1</value>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Server address</value>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>312, 185</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
<data name="label15.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;txtSNI.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="label21.Text" xml:space="preserve">
<value>allowInsecure</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</value>
<data name="label6.Text" xml:space="preserve">
<value>Alias (remarks)</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<data name="label3.Text" xml:space="preserve">
<value>Password</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label21.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>4</value>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>AddServer6Form</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 155</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
<data name="&gt;&gt;cmbStreamSecurity.Name" xml:space="preserve">
<value>cmbStreamSecurity</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 27</value>
</data>
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Edit or add a [Trojan] server</value>
</data>
<data name="cmbStreamSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>60, 20</value>
</data>
<data name="txtId.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;cmbStreamSecurity.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="&gt;&gt;cmbAllowInsecure.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label21.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;txtAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="&gt;&gt;label21.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="cmbStreamSecurity.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label13.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;txtAddress.ZOrder" xml:space="preserve">
<value>13</value>
</data>
<data name="txtId.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 91</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;cmbStreamSecurity.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;txtSNI.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtId.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label13.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
<data name="&gt;&gt;cmbAllowInsecure.Name" xml:space="preserve">
<value>cmbAllowInsecure</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
<data name="&gt;&gt;txtId.Name" xml:space="preserve">
<value>txtId</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 156</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 154</value>
<data name="&gt;&gt;txtId.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 31</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>AddServer6Form</value>
</data>
<data name="&gt;&gt;label15.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtPort.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;cmbStreamSecurity.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 59</value>
</data>
<data name="cmbAllowInsecure.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 20</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="cmbAllowInsecure.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 60</value>
</data>
<data name="&gt;&gt;txtPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="cmbAllowInsecure.Items" xml:space="preserve">
<value />
</data>
<data name="txtSNI.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 10</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="&gt;&gt;txtId.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="label15.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;txtSNI.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;label15.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;txtSNI.Name" xml:space="preserve">
<value>txtSNI</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 12</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 93</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>194, 21</value>
</data>
<data name="&gt;&gt;label13.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="cmbAllowInsecure.Items1" xml:space="preserve">
<value>true</value>
</data>
<data name="txtAddress.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
@ -219,268 +450,208 @@
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 93</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 60</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 12</value>
</data>
<data name="txtId.Size" type="System.Drawing.Size, System.Drawing">
<value>278, 21</value>
</data>
<data name="txtAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtId.PasswordChar" type="System.Char, mscorlib" xml:space="preserve">
<value>*</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>* Fill in manually</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;txtId.Name" xml:space="preserve">
<value>txtId</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 62</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;txtAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;txtId.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Password</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;label13.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtAddress.Name" xml:space="preserve">
<value>txtAddress</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 10</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;txtPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 221</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="txtAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 27</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;txtAddress.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 59</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>Alias (remarks)</value>
</data>
<data name="txtId.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;txtId.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>303, 17</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 31</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Edit or add a [Trojan] server</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Server port</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
<value>337, 158</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="txtId.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 91</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="txtAddress.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;label13.Name" xml:space="preserve">
<value>label13</value>
</data>
<data name="&gt;&gt;txtId.ZOrder" xml:space="preserve">
<value>3</value>
<data name="txtSNI.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 231</value>
</data>
<data name="label13.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="&gt;&gt;txtAddress.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>547, 291</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseServerForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Server port</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>396, 17</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<data name="&gt;&gt;label21.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 231</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
<data name="cmbStreamSecurity.Items" xml:space="preserve">
<value>tls</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="label21.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="label15.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label15.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 189</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cmbStreamSecurity.Items1" xml:space="preserve">
<value>xtls</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="&gt;&gt;label21.Name" xml:space="preserve">
<value>label21</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Server address</value>
</data>
<data name="cmbAllowInsecure.Items2" xml:space="preserve">
<value>false</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>TLS</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 12</value>
</data>
<data name="&gt;&gt;cmbAllowInsecure.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="cmbStreamSecurity.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 185</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>* Fill in manually</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>14</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;cmbAllowInsecure.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 62</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>547, 291</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;label21.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>547, 221</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="&gt;&gt;label15.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label21.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
<value>337, 125</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 121</value>
</data>
<data name="txtId.PasswordChar" type="System.Char, mscorlib" xml:space="preserve">
<value>*</value>
</data>
<data name="&gt;&gt;txtAddress.Name" xml:space="preserve">
<value>txtAddress</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 12</value>
</data>
<data name="label21.Location" type="System.Drawing.Point, System.Drawing">
<value>224, 189</value>
</data>
<data name="&gt;&gt;txtAddress.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label15.Name" xml:space="preserve">
<value>label15</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Server</value>
</data>
<data name="txtSNI.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 152</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 125</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>SNI</value>
</data>
<data name="txtId.Size" type="System.Drawing.Size, System.Drawing">
<value>359, 21</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>zh-Hans</value>
</metadata>
</root>

View file

@ -120,13 +120,29 @@
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label21.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 12</value>
</data>
<data name="label21.Text" xml:space="preserve">
<value>跳过证书验证(allowInsecure)</value>
</data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>406, 185</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 12</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>底层传输安全(tls)</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="cmbStreamSecurity.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>*手填,方便识别管理</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
@ -151,6 +167,9 @@
<data name="label1.Text" xml:space="preserve">
<value>服务器地址</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>

View file

@ -37,6 +37,8 @@
this.label24 = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.panTlsMore = new System.Windows.Forms.Panel();
this.txtSNI = new System.Windows.Forms.TextBox();
this.label22 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.cmbAllowInsecure = new System.Windows.Forms.ComboBox();
this.label9 = new System.Windows.Forms.Label();
@ -78,6 +80,7 @@
this.MenuItemImportServer = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.MenuItemImportClipboard = new System.Windows.Forms.ToolStripMenuItem();
this.label25 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.panTlsMore.SuspendLayout();
@ -129,6 +132,7 @@
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label25);
this.groupBox2.Controls.Add(this.label24);
this.groupBox2.Controls.Add(this.label23);
this.groupBox2.Controls.Add(this.panTlsMore);
@ -165,11 +169,23 @@
//
// panTlsMore
//
this.panTlsMore.Controls.Add(this.txtSNI);
this.panTlsMore.Controls.Add(this.label22);
this.panTlsMore.Controls.Add(this.label21);
this.panTlsMore.Controls.Add(this.cmbAllowInsecure);
resources.ApplyResources(this.panTlsMore, "panTlsMore");
this.panTlsMore.Name = "panTlsMore";
//
// txtSNI
//
resources.ApplyResources(this.txtSNI, "txtSNI");
this.txtSNI.Name = "txtSNI";
//
// label22
//
resources.ApplyResources(this.label22, "label22");
this.label22.Name = "label22";
//
// label21
//
resources.ApplyResources(this.label21, "label21");
@ -210,7 +226,8 @@
resources.GetString("cmbNetwork.Items1"),
resources.GetString("cmbNetwork.Items2"),
resources.GetString("cmbNetwork.Items3"),
resources.GetString("cmbNetwork.Items4")});
resources.GetString("cmbNetwork.Items4"),
resources.GetString("cmbNetwork.Items5")});
resources.ApplyResources(this.cmbNetwork, "cmbNetwork");
this.cmbNetwork.Name = "cmbNetwork";
this.cmbNetwork.SelectedIndexChanged += new System.EventHandler(this.cmbNetwork_SelectedIndexChanged);
@ -427,6 +444,11 @@
resources.ApplyResources(this.MenuItemImportClipboard, "MenuItemImportClipboard");
this.MenuItemImportClipboard.Click += new System.EventHandler(this.MenuItemImportClipboard_Click);
//
// label25
//
resources.ApplyResources(this.label25, "label25");
this.label25.Name = "label25";
//
// AddServerForm
//
resources.ApplyResources(this, "$this");
@ -504,5 +526,8 @@
private System.Windows.Forms.Panel panTlsMore;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.TextBox txtSNI;
private System.Windows.Forms.Label label25;
}
}

View file

@ -45,6 +45,7 @@ namespace v2rayN.Forms
txtPath.Text = vmessItem.path;
cmbStreamSecurity.Text = vmessItem.streamSecurity;
cmbAllowInsecure.Text = vmessItem.allowInsecure;
txtSNI.Text = vmessItem.sni;
}
@ -66,6 +67,7 @@ namespace v2rayN.Forms
cmbStreamSecurity.Text = "";
cmbAllowInsecure.Text = "";
txtPath.Text = "";
txtSNI.Text = "";
}
@ -122,6 +124,7 @@ namespace v2rayN.Forms
string path = txtPath.Text;
string streamSecurity = cmbStreamSecurity.Text;
string allowInsecure = cmbAllowInsecure.Text;
string sni = txtSNI.Text;
if (Utils.IsNullOrEmpty(address))
{
@ -157,6 +160,7 @@ namespace v2rayN.Forms
vmessItem.path = path.Replace(" ", "");
vmessItem.streamSecurity = streamSecurity;
vmessItem.allowInsecure = allowInsecure;
vmessItem.sni = sni;
if (ConfigHandler.AddServer(ref config, vmessItem, EditIndex) == 0)
{
@ -268,7 +272,7 @@ namespace v2rayN.Forms
{
ClearServer();
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
VmessItem vmessItem = ShareHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
if (vmessItem == null)
{
UI.ShowWarning(msg);

View file

@ -194,15 +194,45 @@
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label24.AutoSize" type="System.Boolean, mscorlib">
<data name="label25.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label25.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label25.Location" type="System.Drawing.Point, System.Drawing">
<value>529, 211</value>
</data>
<data name="label25.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
<data name="label25.TabIndex" type="System.Int32, mscorlib">
<value>36</value>
</data>
<data name="label25.Text" xml:space="preserve">
<value>4)grpc serviceName</value>
</data>
<data name="&gt;&gt;label25.Name" xml:space="preserve">
<value>label25</value>
</data>
<data name="&gt;&gt;label25.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label25.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label25.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label24.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label24.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label24.Location" type="System.Drawing.Point, System.Drawing">
<value>529, 207</value>
<value>529, 197</value>
</data>
<data name="label24.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 12</value>
@ -223,7 +253,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label24.ZOrder" xml:space="preserve">
<value>0</value>
<value>1</value>
</data>
<data name="label23.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -253,6 +283,57 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label23.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="txtSNI.Location" type="System.Drawing.Point, System.Drawing">
<value>300, 7</value>
</data>
<data name="txtSNI.Size" type="System.Drawing.Size, System.Drawing">
<value>200, 21</value>
</data>
<data name="txtSNI.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="&gt;&gt;txtSNI.Name" xml:space="preserve">
<value>txtSNI</value>
</data>
<data name="&gt;&gt;txtSNI.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtSNI.Parent" xml:space="preserve">
<value>panTlsMore</value>
</data>
<data name="&gt;&gt;txtSNI.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label22.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label22.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label22.Location" type="System.Drawing.Point, System.Drawing">
<value>270, 11</value>
</data>
<data name="label22.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 12</value>
</data>
<data name="label22.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="label22.Text" xml:space="preserve">
<value>SNI</value>
</data>
<data name="&gt;&gt;label22.Name" xml:space="preserve">
<value>label22</value>
</data>
<data name="&gt;&gt;label22.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label22.Parent" xml:space="preserve">
<value>panTlsMore</value>
</data>
<data name="&gt;&gt;label22.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label21.AutoSize" type="System.Boolean, mscorlib">
@ -280,7 +361,7 @@
<value>panTlsMore</value>
</data>
<data name="&gt;&gt;label21.ZOrder" xml:space="preserve">
<value>0</value>
<value>2</value>
</data>
<data name="cmbAllowInsecure.Items" xml:space="preserve">
<value />
@ -292,10 +373,10 @@
<value>false</value>
</data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>107, 7</value>
<value>100, 7</value>
</data>
<data name="cmbAllowInsecure.Size" type="System.Drawing.Size, System.Drawing">
<value>91, 20</value>
<value>80, 20</value>
</data>
<data name="cmbAllowInsecure.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
@ -310,13 +391,13 @@
<value>panTlsMore</value>
</data>
<data name="&gt;&gt;cmbAllowInsecure.ZOrder" xml:space="preserve">
<value>1</value>
<value>3</value>
</data>
<data name="panTlsMore.Location" type="System.Drawing.Point, System.Drawing">
<value>284, 234</value>
<value>200, 234</value>
</data>
<data name="panTlsMore.Size" type="System.Drawing.Size, System.Drawing">
<value>338, 35</value>
<value>500, 35</value>
</data>
<data name="panTlsMore.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
@ -331,7 +412,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;panTlsMore.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="label9.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -358,7 +439,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label9.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="label20.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -385,7 +466,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label20.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="txtPath.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 169</value>
@ -409,7 +490,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;txtPath.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="cmbNetwork.Items" xml:space="preserve">
<value>tcp</value>
@ -426,6 +507,9 @@
<data name="cmbNetwork.Items4" xml:space="preserve">
<value>quic</value>
</data>
<data name="cmbNetwork.Items5" xml:space="preserve">
<value>grpc</value>
</data>
<data name="cmbNetwork.Location" type="System.Drawing.Point, System.Drawing">
<value>192, 28</value>
</data>
@ -445,7 +529,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;cmbNetwork.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="label7.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -472,7 +556,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label7.ZOrder" xml:space="preserve">
<value>7</value>
<value>8</value>
</data>
<data name="label19.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -499,13 +583,13 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label19.ZOrder" xml:space="preserve">
<value>8</value>
<value>9</value>
</data>
<data name="label18.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label18.Location" type="System.Drawing.Point, System.Drawing">
<value>529, 189</value>
<value>529, 183</value>
</data>
<data name="label18.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 12</value>
@ -526,7 +610,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label18.ZOrder" xml:space="preserve">
<value>9</value>
<value>10</value>
</data>
<data name="label17.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -553,13 +637,13 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label17.ZOrder" xml:space="preserve">
<value>10</value>
<value>11</value>
</data>
<data name="label16.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label16.Location" type="System.Drawing.Point, System.Drawing">
<value>529, 172</value>
<value>529, 169</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 12</value>
@ -580,7 +664,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label16.ZOrder" xml:space="preserve">
<value>11</value>
<value>12</value>
</data>
<data name="label14.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -607,7 +691,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label14.ZOrder" xml:space="preserve">
<value>12</value>
<value>13</value>
</data>
<data name="label15.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -634,7 +718,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label15.ZOrder" xml:space="preserve">
<value>13</value>
<value>14</value>
</data>
<data name="cmbStreamSecurity.Items" xml:space="preserve">
<value />
@ -646,7 +730,7 @@
<value>127, 239</value>
</data>
<data name="cmbStreamSecurity.Size" type="System.Drawing.Size, System.Drawing">
<value>143, 20</value>
<value>60, 20</value>
</data>
<data name="cmbStreamSecurity.TabIndex" type="System.Int32, mscorlib">
<value>21</value>
@ -661,7 +745,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;cmbStreamSecurity.ZOrder" xml:space="preserve">
<value>14</value>
<value>15</value>
</data>
<data name="label12.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -688,7 +772,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>15</value>
<value>16</value>
</data>
<data name="txtRequestHost.Location" type="System.Drawing.Point, System.Drawing">
<value>158, 100</value>
@ -712,7 +796,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;txtRequestHost.ZOrder" xml:space="preserve">
<value>16</value>
<value>17</value>
</data>
<data name="label11.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -739,7 +823,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label11.ZOrder" xml:space="preserve">
<value>17</value>
<value>18</value>
</data>
<data name="label10.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -766,7 +850,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label10.ZOrder" xml:space="preserve">
<value>18</value>
<value>19</value>
</data>
<data name="cmbHeaderType.Items" xml:space="preserve">
<value>none</value>
@ -808,7 +892,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;cmbHeaderType.ZOrder" xml:space="preserve">
<value>19</value>
<value>20</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>

View file

@ -120,18 +120,12 @@
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="btnGUID.Text" xml:space="preserve">
<value>生成(&amp;G)</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>*手填,方便识别管理</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>底层传输方式(transport)</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label24.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 12</value>
@ -152,7 +146,7 @@
<value>跳过证书验证(allowInsecure)</value>
</data>
<data name="cmbAllowInsecure.Location" type="System.Drawing.Point, System.Drawing">
<value>223, 7</value>
<value>180, 7</value>
</data>
<data name="label9.Location" type="System.Drawing.Point, System.Drawing">
<value>350, 36</value>
@ -250,6 +244,9 @@
<data name="cmbHeaderType.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 67</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>底层传输方式(transport)</value>
</data>
<data name="label8.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 12</value>
</data>
@ -298,15 +295,12 @@
<data name="label1.Text" xml:space="preserve">
<value>地址(address)</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>92, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>导入配置文件</value>
</data>
<data name="MenuItemImportClient.Size" type="System.Drawing.Size, System.Drawing">
<value>171, 22</value>
</data>
@ -328,6 +322,12 @@
<data name="MenuItemImportClipboard.Text" xml:space="preserve">
<value>从剪贴板导入URL</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>92, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>导入配置文件</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>编辑或添加[VMess]服务器</value>
</data>

View file

@ -58,27 +58,25 @@
this.menuRealPingServer = new System.Windows.Forms.ToolStripMenuItem();
this.menuSpeedServer = new System.Windows.Forms.ToolStripMenuItem();
this.tsbTestMe = new System.Windows.Forms.ToolStripMenuItem();
this.menuClearServerStatistics = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.menuExport2ClientConfig = new System.Windows.Forms.ToolStripMenuItem();
this.menuExport2ServerConfig = new System.Windows.Forms.ToolStripMenuItem();
this.menuExport2ShareUrl = new System.Windows.Forms.ToolStripMenuItem();
this.menuExport2SubContent = new System.Windows.Forms.ToolStripMenuItem();
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton();
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components);
this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuSysAgentMode = new System.Windows.Forms.ToolStripMenuItem();
this.menuNotEnabledHttp = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepClear = new System.Windows.Forms.ToolStripMenuItem();
this.menuGlobal = new System.Windows.Forms.ToolStripMenuItem();
this.menuGlobalPAC = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeep = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepPAC = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepNothing = new System.Windows.Forms.ToolStripMenuItem();
this.menuKeepPACNothing = new System.Windows.Forms.ToolStripMenuItem();
this.menuRoutings = new System.Windows.Forms.ToolStripMenuItem();
this.menuServers = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.menuAddServers2 = new System.Windows.Forms.ToolStripMenuItem();
this.menuScanScreen2 = new System.Windows.Forms.ToolStripMenuItem();
this.menuCopyPACUrl = new System.Windows.Forms.ToolStripMenuItem();
this.menuUpdateSubscriptions = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.menuExit = new System.Windows.Forms.ToolStripMenuItem();
@ -86,6 +84,11 @@
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtMsgBox = new System.Windows.Forms.TextBox();
this.cmsMsgBox = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuMsgBoxSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopy = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxCopyAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuMsgBoxAddRoutingRule = new System.Windows.Forms.ToolStripMenuItem();
this.ssMain = new System.Windows.Forms.StatusStrip();
this.toolSslSocksPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslSocksPort = new System.Windows.Forms.ToolStripStatusLabel();
@ -93,8 +96,6 @@
this.toolSslHttpPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslHttpPort = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslPacPortLab = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslPacPort = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank3 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslServerSpeed = new System.Windows.Forms.ToolStripStatusLabel();
this.toolSslBlank4 = new System.Windows.Forms.ToolStripStatusLabel();
@ -106,16 +107,16 @@
this.tsbSubUpdate = new System.Windows.Forms.ToolStripMenuItem();
this.tsbQRCodeSwitch = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.tsbOptionSetting = new System.Windows.Forms.ToolStripButton();
this.tsbSetting = new System.Windows.Forms.ToolStripDropDownButton();
this.tsbOptionSetting = new System.Windows.Forms.ToolStripMenuItem();
this.tsbRoutingSetting = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.tsbReload = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.tsbCheckUpdate = new System.Windows.Forms.ToolStripDropDownButton();
this.tsbCheckUpdateN = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateCore = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdatePACList = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator();
this.tsbCheckClearPACList = new System.Windows.Forms.ToolStripMenuItem();
this.tsbCheckUpdateXrayCore = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.tsbHelp = new System.Windows.Forms.ToolStripDropDownButton();
this.tsbAbout = new System.Windows.Forms.ToolStripMenuItem();
@ -134,6 +135,7 @@
this.cmsMain.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.cmsMsgBox.SuspendLayout();
this.ssMain.SuspendLayout();
this.tsMain.SuspendLayout();
this.SuspendLayout();
@ -205,12 +207,14 @@
this.menuRealPingServer,
this.menuSpeedServer,
this.tsbTestMe,
this.menuClearServerStatistics,
this.toolStripSeparator6,
this.menuExport2ClientConfig,
this.menuExport2ServerConfig,
this.menuExport2ShareUrl,
this.menuExport2SubContent});
this.cmsLv.Name = "cmsLv";
this.cmsLv.OwnerItem = this.tsbServer;
//
// menuAddVmessServer
//
@ -359,6 +363,12 @@
this.tsbTestMe.Name = "tsbTestMe";
this.tsbTestMe.Click += new System.EventHandler(this.tsbTestMe_Click);
//
// menuClearServerStatistics
//
resources.ApplyResources(this.menuClearServerStatistics, "menuClearServerStatistics");
this.menuClearServerStatistics.Name = "menuClearServerStatistics";
this.menuClearServerStatistics.Click += new System.EventHandler(this.menuClearStatistic_Click);
//
// toolStripSeparator6
//
resources.ApplyResources(this.toolStripSeparator6, "toolStripSeparator6");
@ -388,11 +398,6 @@
this.menuExport2SubContent.Name = "menuExport2SubContent";
this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click);
//
// qrCodeControl
//
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
this.qrCodeControl.Name = "qrCodeControl";
//
// tsbServer
//
resources.ApplyResources(this.tsbServer, "tsbServer");
@ -400,6 +405,11 @@
this.tsbServer.Image = global::v2rayN.Properties.Resources.server;
this.tsbServer.Name = "tsbServer";
//
// qrCodeControl
//
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
this.qrCodeControl.Name = "qrCodeControl";
//
// notifyMain
//
resources.ApplyResources(this.notifyMain, "notifyMain");
@ -412,10 +422,11 @@
this.cmsMain.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuSysAgentMode,
this.menuRoutings,
this.menuServers,
this.toolStripSeparator13,
this.menuAddServers2,
this.menuScanScreen2,
this.menuCopyPACUrl,
this.menuUpdateSubscriptions,
this.toolStripSeparator2,
this.menuExit});
@ -428,20 +439,16 @@
//
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuNotEnabledHttp,
this.menuKeepClear,
this.menuGlobal,
this.menuGlobalPAC,
this.menuKeep,
this.menuKeepPAC,
this.menuKeepNothing,
this.menuKeepPACNothing});
this.menuKeepNothing});
this.menuSysAgentMode.Name = "menuSysAgentMode";
//
// menuNotEnabledHttp
// menuKeepClear
//
resources.ApplyResources(this.menuNotEnabledHttp, "menuNotEnabledHttp");
this.menuNotEnabledHttp.Name = "menuNotEnabledHttp";
this.menuNotEnabledHttp.Click += new System.EventHandler(this.menuNotEnabledHttp_Click);
resources.ApplyResources(this.menuKeepClear, "menuKeepClear");
this.menuKeepClear.Name = "menuKeepClear";
this.menuKeepClear.Click += new System.EventHandler(this.menuKeepClear_Click);
//
// menuGlobal
//
@ -449,41 +456,27 @@
this.menuGlobal.Name = "menuGlobal";
this.menuGlobal.Click += new System.EventHandler(this.menuGlobal_Click);
//
// menuGlobalPAC
//
resources.ApplyResources(this.menuGlobalPAC, "menuGlobalPAC");
this.menuGlobalPAC.Name = "menuGlobalPAC";
this.menuGlobalPAC.Click += new System.EventHandler(this.menuGlobalPAC_Click);
//
// menuKeep
//
resources.ApplyResources(this.menuKeep, "menuKeep");
this.menuKeep.Name = "menuKeep";
this.menuKeep.Click += new System.EventHandler(this.menuKeep_Click);
//
// menuKeepPAC
//
resources.ApplyResources(this.menuKeepPAC, "menuKeepPAC");
this.menuKeepPAC.Name = "menuKeepPAC";
this.menuKeepPAC.Click += new System.EventHandler(this.menuKeepPAC_Click);
//
// menuKeepNothing
//
resources.ApplyResources(this.menuKeepNothing, "menuKeepNothing");
this.menuKeepNothing.Name = "menuKeepNothing";
this.menuKeepNothing.Click += new System.EventHandler(this.menuKeepNothing_Click);
//
// menuKeepPACNothing
// menuRoutings
//
resources.ApplyResources(this.menuKeepPACNothing, "menuKeepPACNothing");
this.menuKeepPACNothing.Name = "menuKeepPACNothing";
this.menuKeepPACNothing.Click += new System.EventHandler(this.menuKeepPACNothing_Click);
resources.ApplyResources(this.menuRoutings, "menuRoutings");
this.menuRoutings.Name = "menuRoutings";
//
// menuServers
//
resources.ApplyResources(this.menuServers, "menuServers");
this.menuServers.Name = "menuServers";
//
// toolStripSeparator13
//
resources.ApplyResources(this.toolStripSeparator13, "toolStripSeparator13");
this.toolStripSeparator13.Name = "toolStripSeparator13";
//
// menuAddServers2
//
resources.ApplyResources(this.menuAddServers2, "menuAddServers2");
@ -496,12 +489,6 @@
this.menuScanScreen2.Name = "menuScanScreen2";
this.menuScanScreen2.Click += new System.EventHandler(this.menuScanScreen_Click);
//
// menuCopyPACUrl
//
resources.ApplyResources(this.menuCopyPACUrl, "menuCopyPACUrl");
this.menuCopyPACUrl.Name = "menuCopyPACUrl";
this.menuCopyPACUrl.Click += new System.EventHandler(this.menuCopyPACUrl_Click);
//
// menuUpdateSubscriptions
//
resources.ApplyResources(this.menuUpdateSubscriptions, "menuUpdateSubscriptions");
@ -545,13 +532,50 @@
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(49)))), ((int)(((byte)(52)))));
this.txtMsgBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtMsgBox.ContextMenuStrip = this.cmsMsgBox;
this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228)))));
this.txtMsgBox.Name = "txtMsgBox";
this.txtMsgBox.ReadOnly = true;
this.txtMsgBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtMsgBox_KeyDown);
//
// cmsMsgBox
//
resources.ApplyResources(this.cmsMsgBox, "cmsMsgBox");
this.cmsMsgBox.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuMsgBoxSelectAll,
this.menuMsgBoxCopy,
this.menuMsgBoxCopyAll,
this.menuMsgBoxAddRoutingRule});
this.cmsMsgBox.Name = "cmsMsgBox";
//
// menuMsgBoxSelectAll
//
resources.ApplyResources(this.menuMsgBoxSelectAll, "menuMsgBoxSelectAll");
this.menuMsgBoxSelectAll.Name = "menuMsgBoxSelectAll";
this.menuMsgBoxSelectAll.Click += new System.EventHandler(this.menuMsgBoxSelectAll_Click);
//
// menuMsgBoxCopy
//
resources.ApplyResources(this.menuMsgBoxCopy, "menuMsgBoxCopy");
this.menuMsgBoxCopy.Name = "menuMsgBoxCopy";
this.menuMsgBoxCopy.Click += new System.EventHandler(this.menuMsgBoxCopy_Click);
//
// menuMsgBoxCopyAll
//
resources.ApplyResources(this.menuMsgBoxCopyAll, "menuMsgBoxCopyAll");
this.menuMsgBoxCopyAll.Name = "menuMsgBoxCopyAll";
this.menuMsgBoxCopyAll.Click += new System.EventHandler(this.menuMsgBoxCopyAll_Click);
//
// menuMsgBoxAddRoutingRule
//
resources.ApplyResources(this.menuMsgBoxAddRoutingRule, "menuMsgBoxAddRoutingRule");
this.menuMsgBoxAddRoutingRule.Name = "menuMsgBoxAddRoutingRule";
this.menuMsgBoxAddRoutingRule.Click += new System.EventHandler(this.menuMsgBoxAddRoutingRule_Click);
//
// ssMain
//
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.ImageScalingSize = new System.Drawing.Size(20, 20);
this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolSslSocksPortLab,
this.toolSslSocksPort,
@ -559,8 +583,6 @@
this.toolSslHttpPortLab,
this.toolSslHttpPort,
this.toolSslBlank2,
this.toolSslPacPortLab,
this.toolSslPacPort,
this.toolSslBlank3,
this.toolSslServerSpeed,
this.toolSslBlank4});
@ -599,16 +621,6 @@
this.toolSslBlank2.Name = "toolSslBlank2";
this.toolSslBlank2.Spring = true;
//
// toolSslPacPortLab
//
resources.ApplyResources(this.toolSslPacPortLab, "toolSslPacPortLab");
this.toolSslPacPortLab.Name = "toolSslPacPortLab";
//
// toolSslPacPort
//
resources.ApplyResources(this.toolSslPacPort, "toolSslPacPort");
this.toolSslPacPort.Name = "toolSslPacPort";
//
// toolSslBlank3
//
resources.ApplyResources(this.toolSslBlank3, "toolSslBlank3");
@ -641,7 +653,7 @@
this.tsbSub,
this.tsbQRCodeSwitch,
this.toolStripSeparator8,
this.tsbOptionSetting,
this.tsbSetting,
this.toolStripSeparator5,
this.tsbReload,
this.toolStripSeparator7,
@ -694,13 +706,27 @@
resources.ApplyResources(this.toolStripSeparator8, "toolStripSeparator8");
this.toolStripSeparator8.Name = "toolStripSeparator8";
//
// tsbSetting
//
resources.ApplyResources(this.tsbSetting, "tsbSetting");
this.tsbSetting.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbOptionSetting,
this.tsbRoutingSetting});
this.tsbSetting.Image = global::v2rayN.Properties.Resources.option;
this.tsbSetting.Name = "tsbSetting";
//
// tsbOptionSetting
//
resources.ApplyResources(this.tsbOptionSetting, "tsbOptionSetting");
this.tsbOptionSetting.Image = global::v2rayN.Properties.Resources.option;
this.tsbOptionSetting.Name = "tsbOptionSetting";
this.tsbOptionSetting.Click += new System.EventHandler(this.tsbOptionSetting_Click);
//
// tsbRoutingSetting
//
resources.ApplyResources(this.tsbRoutingSetting, "tsbRoutingSetting");
this.tsbRoutingSetting.Name = "tsbRoutingSetting";
this.tsbRoutingSetting.Click += new System.EventHandler(this.tsbRoutingSetting_Click);
//
// toolStripSeparator5
//
resources.ApplyResources(this.toolStripSeparator5, "toolStripSeparator5");
@ -723,9 +749,7 @@
this.tsbCheckUpdate.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbCheckUpdateN,
this.tsbCheckUpdateCore,
this.tsbCheckUpdatePACList,
this.toolStripSeparator13,
this.tsbCheckClearPACList});
this.tsbCheckUpdateXrayCore});
this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate;
this.tsbCheckUpdate.Name = "tsbCheckUpdate";
//
@ -741,22 +765,11 @@
this.tsbCheckUpdateCore.Name = "tsbCheckUpdateCore";
this.tsbCheckUpdateCore.Click += new System.EventHandler(this.tsbCheckUpdateCore_Click);
//
// tsbCheckUpdatePACList
// tsbCheckUpdateXrayCore
//
resources.ApplyResources(this.tsbCheckUpdatePACList, "tsbCheckUpdatePACList");
this.tsbCheckUpdatePACList.Name = "tsbCheckUpdatePACList";
this.tsbCheckUpdatePACList.Click += new System.EventHandler(this.tsbCheckUpdatePACList_Click);
//
// toolStripSeparator13
//
resources.ApplyResources(this.toolStripSeparator13, "toolStripSeparator13");
this.toolStripSeparator13.Name = "toolStripSeparator13";
//
// tsbCheckClearPACList
//
resources.ApplyResources(this.tsbCheckClearPACList, "tsbCheckClearPACList");
this.tsbCheckClearPACList.Name = "tsbCheckClearPACList";
this.tsbCheckClearPACList.Click += new System.EventHandler(this.tsbCheckClearPACList_Click);
resources.ApplyResources(this.tsbCheckUpdateXrayCore, "tsbCheckUpdateXrayCore");
this.tsbCheckUpdateXrayCore.Name = "tsbCheckUpdateXrayCore";
this.tsbCheckUpdateXrayCore.Click += new System.EventHandler(this.tsbCheckUpdateXrayCore_Click);
//
// toolStripSeparator10
//
@ -848,6 +861,7 @@
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.cmsMsgBox.ResumeLayout(false);
this.ssMain.ResumeLayout(false);
this.ssMain.PerformLayout();
this.tsMain.ResumeLayout(false);
@ -880,7 +894,6 @@
private System.Windows.Forms.ToolStripMenuItem menuExport2ServerConfig;
private System.Windows.Forms.ToolStrip tsMain;
private System.Windows.Forms.ToolStripDropDownButton tsbServer;
private System.Windows.Forms.ToolStripButton tsbOptionSetting;
private System.Windows.Forms.ToolStripButton tsbClose;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
@ -893,9 +906,7 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
private System.Windows.Forms.ToolStripMenuItem menuSysAgentMode;
private System.Windows.Forms.ToolStripMenuItem menuGlobal;
private System.Windows.Forms.ToolStripMenuItem menuGlobalPAC;
private System.Windows.Forms.ToolStripMenuItem menuKeep;
private System.Windows.Forms.ToolStripMenuItem menuCopyPACUrl;
private System.Windows.Forms.ToolStripMenuItem menuKeepClear;
private System.Windows.Forms.ToolStripMenuItem menuAddCustomServer;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem menuAddShadowsocksServer;
@ -905,7 +916,6 @@
private System.Windows.Forms.ToolStripDropDownButton tsbCheckUpdate;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateN;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateCore;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdatePACList;
private System.Windows.Forms.ToolStripMenuItem menuAddServers;
private System.Windows.Forms.ToolStripMenuItem menuExport2ShareUrl;
private System.Windows.Forms.ToolStripMenuItem menuSpeedServer;
@ -920,8 +930,6 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolStripMenuItem tsbSubSetting;
private System.Windows.Forms.ToolStripMenuItem tsbSubUpdate;
private System.Windows.Forms.ToolStripMenuItem tsbCheckClearPACList;
private System.Windows.Forms.ToolStripMenuItem menuKeepPAC;
private System.Windows.Forms.ToolStripMenuItem menuSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuExport2SubContent;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator12;
@ -934,27 +942,34 @@
private System.Windows.Forms.ToolStripStatusLabel toolSslHttpPort;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank2;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank1;
private System.Windows.Forms.ToolStripStatusLabel toolSslPacPort;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank3;
private System.Windows.Forms.ToolStripStatusLabel toolSslSocksPortLab;
private System.Windows.Forms.ToolStripStatusLabel toolSslHttpPortLab;
private System.Windows.Forms.ToolStripStatusLabel toolSslPacPortLab;
private System.Windows.Forms.ToolStripStatusLabel toolSslServerSpeed;
private System.Windows.Forms.ToolStripStatusLabel toolSslBlank4;
private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer;
private System.Windows.Forms.ToolStripMenuItem menuTcpingServer;
private System.Windows.Forms.ToolStripMenuItem menuRealPingServer;
private System.Windows.Forms.ToolStripMenuItem menuNotEnabledHttp;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem menuUpdateSubscriptions;
private System.Windows.Forms.ToolStripMenuItem tsbV2rayWebsite;
private System.Windows.Forms.ToolStripMenuItem menuKeepNothing;
private System.Windows.Forms.ToolStripMenuItem menuKeepPACNothing;
private System.Windows.Forms.ToolStripMenuItem tsbTestMe;
private System.Windows.Forms.ToolStripButton tsbReload;
private System.Windows.Forms.ToolStripButton tsbQRCodeSwitch;
private System.Windows.Forms.ToolStripMenuItem menuAddVlessServer;
private System.Windows.Forms.ToolStripMenuItem menuAddTrojanServer;
private System.Windows.Forms.ToolStripDropDownButton tsbSetting;
private System.Windows.Forms.ToolStripMenuItem tsbOptionSetting;
private System.Windows.Forms.ToolStripMenuItem tsbRoutingSetting;
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateXrayCore;
private System.Windows.Forms.ToolStripMenuItem menuClearServerStatistics;
private System.Windows.Forms.ToolStripMenuItem menuRoutings;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ContextMenuStrip cmsMsgBox;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopy;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxAddRoutingRule;
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopyAll;
}
}

View file

@ -35,8 +35,8 @@ namespace v2rayN.Forms
{
v2rayHandler.V2rayStop();
HttpProxyHandle.CloseHttpAgent(config);
PACServerHandle.Stop();
//HttpProxyHandle.CloseHttpAgent(config);
HttpProxyHandle.UpdateSysProxy(config, true);
ConfigHandler.SaveConfig(ref config);
statistics?.SaveToFile();
@ -47,6 +47,7 @@ namespace v2rayN.Forms
private void MainForm_Load(object sender, EventArgs e)
{
ConfigHandler.LoadConfig(ref config);
ConfigHandler.InitBuiltinRouting(ref config);
v2rayHandler = new V2rayHandler();
v2rayHandler.ProcessEvent += v2rayHandler_ProcessEvent;
@ -73,6 +74,7 @@ namespace v2rayN.Forms
{
InitServersView();
RefreshServers();
RefreshRoutingsMenu();
RestoreUI();
LoadV2ray();
@ -205,6 +207,8 @@ namespace v2rayN.Forms
/// </summary>
private void RefreshServersView()
{
int index = lvServers.SelectedIndices.Count > 0 ? lvServers.SelectedIndices[0] : -1;
lvServers.BeginUpdate();
lvServers.Items.Clear();
@ -222,10 +226,6 @@ namespace v2rayN.Forms
VmessItem item = config.vmess[k];
void _addSubItem(ListViewItem i, string name, string text)
{
i.SubItems.Add(new ListViewItem.ListViewSubItem() { Name = name, Text = text });
}
bool stats = statistics != null && statistics.Enable;
if (stats)
{
@ -239,20 +239,20 @@ namespace v2rayN.Forms
}
}
ListViewItem lvItem = new ListViewItem(def);
_addSubItem(lvItem, EServerColName.configType.ToString(), ((EConfigType)item.configType).ToString());
_addSubItem(lvItem, EServerColName.remarks.ToString(), item.remarks);
_addSubItem(lvItem, EServerColName.address.ToString(), item.address);
_addSubItem(lvItem, EServerColName.port.ToString(), item.port.ToString());
_addSubItem(lvItem, EServerColName.security.ToString(), item.security);
_addSubItem(lvItem, EServerColName.network.ToString(), item.network);
_addSubItem(lvItem, EServerColName.subRemarks.ToString(), item.getSubRemarks(config));
_addSubItem(lvItem, EServerColName.testResult.ToString(), item.testResult);
Utils.AddSubItem(lvItem, EServerColName.configType.ToString(), ((EConfigType)item.configType).ToString());
Utils.AddSubItem(lvItem, EServerColName.remarks.ToString(), item.remarks);
Utils.AddSubItem(lvItem, EServerColName.address.ToString(), item.address);
Utils.AddSubItem(lvItem, EServerColName.port.ToString(), item.port.ToString());
Utils.AddSubItem(lvItem, EServerColName.security.ToString(), item.security);
Utils.AddSubItem(lvItem, EServerColName.network.ToString(), item.network);
Utils.AddSubItem(lvItem, EServerColName.subRemarks.ToString(), item.getSubRemarks(config));
Utils.AddSubItem(lvItem, EServerColName.testResult.ToString(), item.testResult);
if (stats)
{
_addSubItem(lvItem, EServerColName.todayDown.ToString(), todayDown);
_addSubItem(lvItem, EServerColName.todayUp.ToString(), todayUp);
_addSubItem(lvItem, EServerColName.totalDown.ToString(), totalDown);
_addSubItem(lvItem, EServerColName.totalUp.ToString(), totalUp);
Utils.AddSubItem(lvItem, EServerColName.todayDown.ToString(), todayDown);
Utils.AddSubItem(lvItem, EServerColName.todayUp.ToString(), todayUp);
Utils.AddSubItem(lvItem, EServerColName.totalDown.ToString(), totalDown);
Utils.AddSubItem(lvItem, EServerColName.totalUp.ToString(), totalUp);
}
if (k % 2 == 1) // 隔行着色
@ -270,15 +270,11 @@ namespace v2rayN.Forms
}
lvServers.EndUpdate();
//if (lvServers.Items.Count > 0)
//{
// if (lvServers.Items.Count <= testConfigIndex)
// {
// testConfigIndex = lvServers.Items.Count - 1;
// }
// lvServers.Items[testConfigIndex].Selected = true;
// lvServers.Select();
//}
if (index >= 0 && index < lvServers.Items.Count && lvServers.Items.Count > 0)
{
lvServers.Items[index].Selected = true;
lvServers.EnsureVisible(index); // workaround
}
}
/// <summary>
@ -343,29 +339,8 @@ namespace v2rayN.Forms
private void DisplayToolStatus()
{
toolSslSocksPort.Text =
toolSslHttpPort.Text =
toolSslPacPort.Text = "OFF";
toolSslSocksPort.Text = $"{Global.Loopback}:{config.inbound[0].localPort}";
if (config.listenerType != (int)ListenerType.noHttpProxy)
{
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.httpPort}";
if (config.listenerType == ListenerType.GlobalPac ||
config.listenerType == ListenerType.PacOpenAndClear ||
config.listenerType == ListenerType.PacOpenOnly)
{
if (PACServerHandle.IsRunning)
{
toolSslPacPort.Text = $"{HttpProxyHandle.GetPacUrl()}";
}
else
{
toolSslPacPort.Text = UIRes.I18N("StartPacFailed");
}
}
}
notifyMain.Icon = MainFormHandler.Instance.GetNotifyIcon(config, this.Icon);
}
@ -426,7 +401,7 @@ namespace v2rayN.Forms
ConfigHandler.SaveConfig(ref config, false);
statistics?.SaveToFile();
ChangePACButtonStatus(config.listenerType);
ChangePACButtonStatus(config.sysProxyType);
tsbReload.Enabled = true;
}
@ -504,7 +479,6 @@ namespace v2rayN.Forms
fm.EditIndex = index;
if (fm.ShowDialog() == DialogResult.OK)
{
//刷新
RefreshServers();
LoadV2ray();
}
@ -595,7 +569,6 @@ namespace v2rayN.Forms
{
ConfigHandler.RemoveServer(ref config, lvSelecteds[k]);
}
//刷新
RefreshServers();
LoadV2ray();
@ -610,7 +583,6 @@ namespace v2rayN.Forms
{
config.vmess = servers;
}
//刷新
RefreshServers();
LoadV2ray();
UI.Show(string.Format(UIRes.I18N("RemoveDuplicateServerResult"), oldCount, newCount));
@ -625,7 +597,6 @@ namespace v2rayN.Forms
}
if (ConfigHandler.CopyServer(ref config, index) == 0)
{
//刷新
RefreshServers();
}
}
@ -687,6 +658,15 @@ namespace v2rayN.Forms
string result = httpProxyTest() + "ms";
AppendText(false, string.Format(UIRes.I18N("TestMeOutput"), result));
}
private void menuClearStatistic_Click(object sender, EventArgs e)
{
if (statistics != null)
{
statistics.ClearAllServerStatistics();
}
}
private int httpProxyTest()
{
SpeedtestHandler statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, "", UpdateSpeedtestHandler);
@ -712,7 +692,7 @@ namespace v2rayN.Forms
StringBuilder sb = new StringBuilder();
foreach (int v in lvSelecteds)
{
string url = ConfigHandler.GetVmessQRCode(config, v);
string url = ShareHandler.GetShareUrl(config, v);
if (Utils.IsNullOrEmpty(url))
{
continue;
@ -735,7 +715,7 @@ namespace v2rayN.Forms
StringBuilder sb = new StringBuilder();
foreach (int v in lvSelecteds)
{
string url = ConfigHandler.GetVmessQRCode(config, v);
string url = ShareHandler.GetShareUrl(config, v);
if (Utils.IsNullOrEmpty(url))
{
continue;
@ -755,10 +735,19 @@ namespace v2rayN.Forms
OptionSettingForm fm = new OptionSettingForm();
if (fm.ShowDialog() == DialogResult.OK)
{
//刷新
RefreshServers();
LoadV2ray();
HttpProxyHandle.RestartHttpAgent(config, true);
}
}
private void tsbRoutingSetting_Click(object sender, EventArgs e)
{
var fm = new RoutingSettingForm();
if (fm.ShowDialog() == DialogResult.OK)
{
RefreshRoutingsMenu();
RefreshServers();
LoadV2ray();
}
}
@ -788,7 +777,6 @@ namespace v2rayN.Forms
}
if (ConfigHandler.SetDefaultServer(ref config, index) == 0)
{
//刷新
RefreshServers();
LoadV2ray();
}
@ -845,9 +833,8 @@ namespace v2rayN.Forms
if (ConfigHandler.AddCustomServer(ref config, fileName) == 0)
{
//刷新
RefreshServers();
LoadV2ray();
//LoadV2ray();
UI.Show(UIRes.I18N("SuccessfullyImportedCustomServer"));
}
else
@ -877,10 +864,11 @@ namespace v2rayN.Forms
private void menuAddServers_Click(object sender, EventArgs e)
{
string clipboardData = Utils.GetClipboardData();
int result = AddBatchServers(clipboardData);
if (result > 0)
int ret = MainFormHandler.Instance.AddBatchServers(config, clipboardData);
if (ret > 0)
{
UI.Show(string.Format(UIRes.I18N("SuccessfullyImportedServerViaClipboard"), result));
RefreshServers();
UI.Show(string.Format(UIRes.I18N("SuccessfullyImportedServerViaClipboard"), ret));
}
}
@ -890,23 +878,6 @@ namespace v2rayN.Forms
bgwScan.RunWorkerAsync();
}
private int AddBatchServers(string clipboardData, string subid = "")
{
int counter;
int _Add()
{
return ConfigHandler.AddBatchServers(ref config, clipboardData, subid);
}
counter = _Add();
if (counter < 1)
{
clipboardData = Utils.Base64Decode(clipboardData);
counter = _Add();
}
RefreshServers();
return counter;
}
private void menuUpdateSubscriptions_Click(object sender, EventArgs e)
{
UpdateSubscriptionProcess();
@ -1020,10 +991,11 @@ namespace v2rayN.Forms
this.ShowInTaskbar = true;
//this.notifyIcon1.Visible = false;
this.txtMsgBox.ScrollToCaret();
if (config.index >= 0 && config.index < lvServers.Items.Count)
{
lvServers.EnsureVisible(config.index); // workaround
}
//if (config.index >= 0 && config.index < lvServers.Items.Count)
//{
// lvServers.Items[config.index].Selected = true;
// lvServers.EnsureVisible(config.index); // workaround
//}
SetVisibleCore(true);
}
@ -1136,7 +1108,7 @@ namespace v2rayN.Forms
{
//TODO: reload is not good.
RefreshServers();
LoadV2ray();
//LoadV2ray();
}
}
private void menuSelectAll_Click(object sender, EventArgs e)
@ -1150,56 +1122,36 @@ namespace v2rayN.Forms
#endregion
#region
private void menuCopyPACUrl_Click(object sender, EventArgs e)
private void menuKeepClear_Click(object sender, EventArgs e)
{
Utils.SetClipboardData(HttpProxyHandle.GetPacUrl());
}
private void menuNotEnabledHttp_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.noHttpProxy);
SetListenerType(ESysProxyType.ForcedClear);
}
private void menuGlobal_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.GlobalHttp);
}
private void menuGlobalPAC_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.GlobalPac);
}
private void menuKeep_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.HttpOpenAndClear);
}
private void menuKeepPAC_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.PacOpenAndClear);
SetListenerType(ESysProxyType.ForcedChange);
}
private void menuKeepNothing_Click(object sender, EventArgs e)
{
SetListenerType(ListenerType.HttpOpenOnly);
SetListenerType(ESysProxyType.Unchanged);
}
private void menuKeepPACNothing_Click(object sender, EventArgs e)
private void SetListenerType(ESysProxyType type)
{
SetListenerType(ListenerType.PacOpenOnly);
}
private void SetListenerType(ListenerType type)
{
config.listenerType = type;
config.sysProxyType = type;
ChangePACButtonStatus(type);
}
private void ChangePACButtonStatus(ListenerType type)
private void ChangePACButtonStatus(ESysProxyType type)
{
if (type != ListenerType.noHttpProxy)
{
HttpProxyHandle.RestartHttpAgent(config, false);
}
else
{
HttpProxyHandle.CloseHttpAgent(config);
}
HttpProxyHandle.UpdateSysProxy(config, false);
//if (type != ListenerType.noHttpProxy)
//{
// HttpProxyHandle.RestartHttpAgent(config, false);
//}
//else
//{
// HttpProxyHandle.CloseHttpAgent(config);
//}
for (int k = 0; k < menuSysAgentMode.DropDownItems.Count; k++)
{
@ -1301,6 +1253,16 @@ namespace v2rayN.Forms
}
private void tsbCheckUpdateCore_Click(object sender, EventArgs e)
{
CheckUpdateCore("v2fly");
}
private void tsbCheckUpdateXrayCore_Click(object sender, EventArgs e)
{
CheckUpdateCore("xray");
}
private void CheckUpdateCore(string type)
{
DownloadHandle downloadHandle = null;
if (downloadHandle == null)
@ -1310,7 +1272,7 @@ namespace v2rayN.Forms
{
if (args.Success)
{
AppendText(false, string.Format(UIRes.I18N("MsgParsingSuccessfully"), "v2rayCore"));
AppendText(false, string.Format(UIRes.I18N("MsgParsingSuccessfully"), "Core"));
string url = args.Msg;
this.Invoke((MethodInvoker)(delegate
@ -1336,7 +1298,7 @@ namespace v2rayN.Forms
string fileName = downloadHandle.DownloadFileName;
fileName = Utils.GetPath(fileName);
FileManager.ZipExtractToFile(fileName);
FileManager.ZipExtractToFile(fileName, config.ignoreGeoUpdateCore ? "geo" : "");
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfullyMore"));
@ -1361,54 +1323,8 @@ namespace v2rayN.Forms
};
}
AppendText(false, string.Format(UIRes.I18N("MsgStartUpdating"), "v2rayCore"));
downloadHandle.CheckUpdateAsync("Core");
}
private void tsbCheckUpdatePACList_Click(object sender, EventArgs e)
{
DownloadHandle pacListHandle = null;
if (pacListHandle == null)
{
pacListHandle = new DownloadHandle();
pacListHandle.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
string result = args.Msg;
if (Utils.IsNullOrEmpty(result))
{
return;
}
pacListHandle.GenPacFile(result);
AppendText(false, UIRes.I18N("MsgPACUpdateSuccessfully"));
}
else
{
AppendText(false, UIRes.I18N("MsgPACUpdateFailed"));
}
};
pacListHandle.Error += (sender2, args) =>
{
AppendText(true, args.GetException().Message);
};
}
AppendText(false, UIRes.I18N("MsgStartUpdatingPAC"));
pacListHandle.WebDownloadString(config.urlGFWList);
}
private void tsbCheckClearPACList_Click(object sender, EventArgs e)
{
try
{
File.WriteAllText(Utils.GetPath(Global.pacFILE), Utils.GetEmbedText(Global.BlankPacFileName), Encoding.UTF8);
AppendText(false, UIRes.I18N("MsgSimplifyPAC"));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
AppendText(false, string.Format(UIRes.I18N("MsgStartUpdating"), "Core"));
downloadHandle.CheckUpdateAsync(type);
}
#endregion
@ -1451,8 +1367,10 @@ namespace v2rayN.Forms
}
else
{
if (AddBatchServers(result) > 0)
int ret = MainFormHandler.Instance.AddBatchServers(config, result);
if (ret > 0)
{
RefreshServers();
UI.Show(UIRes.I18N("SuccessfullyImportedServerViaScan"));
}
}
@ -1480,67 +1398,15 @@ namespace v2rayN.Forms
/// </summary>
private void UpdateSubscriptionProcess()
{
AppendText(false, UIRes.I18N("MsgUpdateSubscriptionStart"));
if (config.subItem == null || config.subItem.Count <= 0)
void _updateUI(bool refresh, string msg)
{
AppendText(false, UIRes.I18N("MsgNoValidSubscription"));
return;
}
for (int k = 1; k <= config.subItem.Count; k++)
AppendText(false, msg);
if (refresh)
{
string id = config.subItem[k - 1].id.TrimEx();
string url = config.subItem[k - 1].url.TrimEx();
string hashCode = $"{k}->";
if (config.subItem[k - 1].enabled == false)
{
continue;
}
if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url))
{
AppendText(false, $"{hashCode}{UIRes.I18N("MsgNoValidSubscription")}");
continue;
}
DownloadHandle downloadHandle3 = new DownloadHandle();
downloadHandle3.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
AppendText(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}");
string result = Utils.Base64Decode(args.Msg);
if (Utils.IsNullOrEmpty(result))
{
AppendText(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}");
return;
}
ConfigHandler.RemoveServerViaSubid(ref config, id);
AppendText(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}");
RefreshServers();
if (AddBatchServers(result, id) > 0)
{
}
else
{
AppendText(false, $"{hashCode}{UIRes.I18N("MsgFailedImportSubscription")}");
}
AppendText(false, $"{hashCode}{UIRes.I18N("MsgUpdateSubscriptionEnd")}");
}
else
{
AppendText(false, args.Msg);
}
};
downloadHandle3.Error += (sender2, args) =>
{
AppendText(true, args.GetException().Message);
};
downloadHandle3.WebDownloadString(url);
AppendText(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}");
}
MainFormHandler.Instance.UpdateSubscriptionProcess(config, _updateUI);
}
private void tsbQRCodeSwitch_CheckedChanged(object sender, EventArgs e)
@ -1570,8 +1436,114 @@ namespace v2rayN.Forms
#endregion
#region RoutingsMenu
/// <summary>
///
/// </summary>
private void RefreshRoutingsMenu()
{
menuRoutings.Visible = config.enableRoutingAdvanced;
if (!config.enableRoutingAdvanced)
{
return;
}
menuRoutings.DropDownItems.Clear();
List<ToolStripMenuItem> lst = new List<ToolStripMenuItem>();
for (int k = 0; k < config.routings.Count; k++)
{
var item = config.routings[k];
if (item.locked == true)
{
continue;
}
string name = item.remarks;
ToolStripMenuItem ts = new ToolStripMenuItem(name)
{
Tag = k
};
if (config.routingIndex.Equals(k))
{
ts.Checked = true;
}
ts.Click += new EventHandler(ts_Routing_Click);
lst.Add(ts);
}
menuRoutings.DropDownItems.AddRange(lst.ToArray());
}
private void ts_Routing_Click(object sender, EventArgs e)
{
try
{
ToolStripItem ts = (ToolStripItem)sender;
int index = Utils.ToInt(ts.Tag);
if (ConfigHandler.SetDefaultRouting(ref config, index) == 0)
{
RefreshRoutingsMenu();
LoadV2ray();
}
}
catch
{
}
}
#endregion
#region MsgBoxMenu
private void menuMsgBoxSelectAll_Click(object sender, EventArgs e)
{
this.txtMsgBox.Focus();
this.txtMsgBox.SelectAll();
}
private void menuMsgBoxCopy_Click(object sender, EventArgs e)
{
var data = this.txtMsgBox.SelectedText.TrimEx();
Utils.SetClipboardData(data);
}
private void menuMsgBoxCopyAll_Click(object sender, EventArgs e)
{
var data = this.txtMsgBox.Text;
Utils.SetClipboardData(data);
}
private void menuMsgBoxAddRoutingRule_Click(object sender, EventArgs e)
{
menuMsgBoxCopy_Click(null, null);
tsbRoutingSetting_Click(null, null);
}
private void txtMsgBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
{
switch (e.KeyCode)
{
case Keys.A:
menuMsgBoxSelectAll_Click(null, null);
break;
case Keys.C:
menuMsgBoxCopy_Click(null, null);
break;
case Keys.V:
menuMsgBoxAddRoutingRule_Click(null, null);
break;
}
}
}
#endregion
}
}

File diff suppressed because it is too large Load diff

View file

@ -259,6 +259,12 @@
<data name="tsbTestMe.Text" xml:space="preserve">
<value>测试当前服务状态</value>
</data>
<data name="menuClearServerStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 22</value>
</data>
<data name="menuClearServerStatistics.Text" xml:space="preserve">
<value>清除所有服务统计数据</value>
</data>
<data name="toolStripSeparator6.Size" type="System.Drawing.Size, System.Drawing">
<value>297, 6</value>
</data>
@ -286,8 +292,14 @@
<data name="menuExport2SubContent.Text" xml:space="preserve">
<value>批量导出订阅内容至剪贴板(多选)</value>
</data>
<data name="tsbServer.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 53</value>
</data>
<data name="tsbServer.Text" xml:space="preserve">
<value> 服务器 </value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>301, 600</value>
<value>301, 622</value>
</data>
<data name="lvServers.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
@ -306,62 +318,35 @@
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="tsbServer.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 53</value>
<data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 22</value>
</data>
<data name="tsbServer.Text" xml:space="preserve">
<value> 服务器 </value>
<data name="menuKeepClear.Text" xml:space="preserve">
<value>清除系统代理</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 164</value>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 22</value>
</data>
<data name="menuGlobal.Text" xml:space="preserve">
<value>自动配置系统代理</value>
</data>
<data name="menuKeepNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 22</value>
</data>
<data name="menuKeepNothing.Text" xml:space="preserve">
<value>不改变系统代理</value>
</data>
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuSysAgentMode.Text" xml:space="preserve">
<value>Http代理</value>
<value>系统代理</value>
</data>
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
<data name="menuRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
<value>关闭Http代理</value>
</data>
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuGlobal.Text" xml:space="preserve">
<value>开启Http代理,并自动配置系统代理(全局模式)</value>
</data>
<data name="menuGlobalPAC.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuGlobalPAC.Text" xml:space="preserve">
<value>开启PAC,并自动配置系统代理(PAC模式)</value>
</data>
<data name="menuKeep.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuKeep.Text" xml:space="preserve">
<value>仅开启Http代理,并清除系统代理</value>
</data>
<data name="menuKeepPAC.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuKeepPAC.Text" xml:space="preserve">
<value>仅开启PAC,并清除系统代理</value>
</data>
<data name="menuKeepNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuKeepNothing.Text" xml:space="preserve">
<value>仅开启Http代理,不改变系统代理</value>
</data>
<data name="menuKeepPACNothing.Size" type="System.Drawing.Size, System.Drawing">
<value>316, 22</value>
</data>
<data name="menuKeepPACNothing.Text" xml:space="preserve">
<value>仅开启PAC,不改变系统代理</value>
<data name="menuRoutings.Text" xml:space="preserve">
<value>路由</value>
</data>
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
@ -369,6 +354,9 @@
<data name="menuServers.Text" xml:space="preserve">
<value>服务器</value>
</data>
<data name="toolStripSeparator13.Size" type="System.Drawing.Size, System.Drawing">
<value>192, 6</value>
</data>
<data name="menuAddServers2.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
@ -381,12 +369,6 @@
<data name="menuScanScreen2.Text" xml:space="preserve">
<value>扫描屏幕上的二维码</value>
</data>
<data name="menuCopyPACUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
<data name="menuCopyPACUrl.Text" xml:space="preserve">
<value>复制本地PAC网址</value>
</data>
<data name="menuUpdateSubscriptions.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 22</value>
</data>
@ -402,20 +384,44 @@
<data name="menuExit.Text" xml:space="preserve">
<value>退出</value>
</data>
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 170</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>服务器列表</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>信息</value>
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxSelectAll.Text" xml:space="preserve">
<value>全选 (Ctrl+A)</value>
</data>
<data name="menuMsgBoxCopy.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxCopy.Text" xml:space="preserve">
<value>复制 (Ctrl+C)</value>
</data>
<data name="menuMsgBoxCopyAll.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxCopyAll.Text" xml:space="preserve">
<value>复制所有</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 22</value>
</data>
<data name="menuMsgBoxAddRoutingRule.Text" xml:space="preserve">
<value>快速添加路由规则 (Ctrl+V)</value>
</data>
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
<value>222, 114</value>
</data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
<data name="groupBox2.Text" xml:space="preserve">
<value>信息</value>
</data>
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 22</value>
@ -429,6 +435,12 @@
<data name="tsbSubUpdate.Text" xml:space="preserve">
<value>更新订阅</value>
</data>
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSub.Text" xml:space="preserve">
<value> 订阅 </value>
</data>
<data name="tsbQRCodeSwitch.Size" type="System.Drawing.Size, System.Drawing">
<value>52, 53</value>
</data>
@ -436,10 +448,22 @@
<value> 分享 </value>
</data>
<data name="tsbOptionSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 53</value>
<value>124, 22</value>
</data>
<data name="tsbOptionSetting.Text" xml:space="preserve">
<value> 参数设置 </value>
<value>参数设置</value>
</data>
<data name="tsbRoutingSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>124, 22</value>
</data>
<data name="tsbRoutingSetting.Text" xml:space="preserve">
<value>路由设置</value>
</data>
<data name="tsbSetting.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 53</value>
</data>
<data name="tsbSetting.Text" xml:space="preserve">
<value> 设置 </value>
</data>
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@ -458,38 +482,35 @@
<data name="tsbReload.Text" xml:space="preserve">
<value> 重启服务 </value>
</data>
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
<value>135, 22</value>
</data>
<data name="tsbCheckUpdateN.Text" xml:space="preserve">
<value>v2rayN</value>
</data>
<data name="tsbCheckUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>135, 22</value>
</data>
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
<value>v2fly-Core</value>
</data>
<data name="tsbCheckUpdateXrayCore.Size" type="System.Drawing.Size, System.Drawing">
<value>135, 22</value>
</data>
<data name="tsbCheckUpdateXrayCore.Text" xml:space="preserve">
<value>Xray-Core</value>
</data>
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>85, 53</value>
</data>
<data name="tsbCheckUpdate.Text" xml:space="preserve">
<value> 检查更新 </value>
</data>
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 22</value>
<data name="tsbAbout.Text" xml:space="preserve">
<value>v2rayN 项目</value>
</data>
<data name="tsbCheckUpdateN.Text" xml:space="preserve">
<value>v2rayN</value>
</data>
<data name="tsbCheckUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 22</value>
</data>
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
<value>v2rayCore</value>
</data>
<data name="tsbCheckUpdatePACList.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 22</value>
</data>
<data name="tsbCheckUpdatePACList.Text" xml:space="preserve">
<value>PAC</value>
</data>
<data name="toolStripSeparator13.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 6</value>
</data>
<data name="tsbCheckClearPACList.Size" type="System.Drawing.Size, System.Drawing">
<value>223, 22</value>
</data>
<data name="tsbCheckClearPACList.Text" xml:space="preserve">
<value>简化PAC (请设置Core路由)</value>
<data name="tsbV2rayWebsite.Text" xml:space="preserve">
<value>V2Ray 官网</value>
</data>
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 53</value>
@ -497,12 +518,6 @@
<data name="tsbHelp.Text" xml:space="preserve">
<value> 帮助 </value>
</data>
<data name="tsbAbout.Text" xml:space="preserve">
<value>v2rayN 项目</value>
</data>
<data name="tsbV2rayWebsite.Text" xml:space="preserve">
<value>V2Ray 官网</value>
</data>
<data name="tsbPromotion.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 53</value>
</data>

View file

@ -34,12 +34,8 @@
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.chkdefAllowInsecure = new System.Windows.Forms.CheckBox();
this.label16 = new System.Windows.Forms.Label();
this.cmblistenerType = new System.Windows.Forms.ComboBox();
this.chksniffingEnabled2 = new System.Windows.Forms.CheckBox();
this.chksniffingEnabled = new System.Windows.Forms.CheckBox();
this.txtremoteDNS = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.chkmuxEnabled = new System.Windows.Forms.CheckBox();
this.chkAllowIn2 = new System.Windows.Forms.CheckBox();
this.chkudpEnabled2 = new System.Windows.Forms.CheckBox();
@ -55,21 +51,9 @@
this.txtlocalPort = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.txtUseragent = new System.Windows.Forms.TextBox();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.txtUserdirect = new System.Windows.Forms.TextBox();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.txtUserblock = new System.Windows.Forms.TextBox();
this.tabPage8 = new System.Windows.Forms.TabPage();
this.cmbroutingMode = new System.Windows.Forms.ComboBox();
this.panel3 = new System.Windows.Forms.Panel();
this.linkLabelRoutingDoc = new System.Windows.Forms.LinkLabel();
this.btnSetDefRountingRule = new System.Windows.Forms.Button();
this.labRoutingTips = new System.Windows.Forms.Label();
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
this.linkDnsObjectDoc = new System.Windows.Forms.LinkLabel();
this.txtremoteDNS = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.tabPage6 = new System.Windows.Forms.TabPage();
this.chkKcpcongestion = new System.Windows.Forms.CheckBox();
this.txtKcpwriteBufferSize = new System.Windows.Forms.TextBox();
@ -85,18 +69,15 @@
this.txtKcpmtu = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.chkIgnoreGeoUpdateCore = new System.Windows.Forms.CheckBox();
this.cmbCoreType = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.chkKeepOlderDedupl = new System.Windows.Forms.CheckBox();
this.cbFreshrate = new System.Windows.Forms.ComboBox();
this.lbFreshrate = new System.Windows.Forms.Label();
this.chkEnableStatistics = new System.Windows.Forms.CheckBox();
this.chkAllowLANConn = new System.Windows.Forms.CheckBox();
this.txturlGFWList = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.chkAutoRun = new System.Windows.Forms.CheckBox();
this.tabPage9 = new System.Windows.Forms.TabPage();
this.txtuserPacRule = new System.Windows.Forms.TextBox();
this.panel4 = new System.Windows.Forms.Panel();
this.label4 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
@ -104,56 +85,41 @@
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tabControl2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout();
this.tabPage8.SuspendLayout();
this.panel3.SuspendLayout();
this.tabPage6.SuspendLayout();
this.tabPage7.SuspendLayout();
this.tabPage9.SuspendLayout();
this.panel4.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// btnClose
//
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// tabControl1
//
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPage9);
resources.ApplyResources(this.tabControl1, "tabControl1");
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
//
// tabPage1
//
resources.ApplyResources(this.tabPage1, "tabPage1");
this.tabPage1.Controls.Add(this.groupBox1);
resources.ApplyResources(this.tabPage1, "tabPage1");
this.tabPage1.Name = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true;
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.chkdefAllowInsecure);
this.groupBox1.Controls.Add(this.label16);
this.groupBox1.Controls.Add(this.cmblistenerType);
this.groupBox1.Controls.Add(this.chksniffingEnabled2);
this.groupBox1.Controls.Add(this.chksniffingEnabled);
this.groupBox1.Controls.Add(this.txtremoteDNS);
this.groupBox1.Controls.Add(this.label14);
this.groupBox1.Controls.Add(this.chkmuxEnabled);
this.groupBox1.Controls.Add(this.chkAllowIn2);
this.groupBox1.Controls.Add(this.chkudpEnabled2);
@ -168,6 +134,7 @@
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtlocalPort);
this.groupBox1.Controls.Add(this.label2);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
@ -177,26 +144,6 @@
this.chkdefAllowInsecure.Name = "chkdefAllowInsecure";
this.chkdefAllowInsecure.UseVisualStyleBackColor = true;
//
// label16
//
resources.ApplyResources(this.label16, "label16");
this.label16.Name = "label16";
//
// cmblistenerType
//
resources.ApplyResources(this.cmblistenerType, "cmblistenerType");
this.cmblistenerType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmblistenerType.FormattingEnabled = true;
this.cmblistenerType.Items.AddRange(new object[] {
resources.GetString("cmblistenerType.Items"),
resources.GetString("cmblistenerType.Items1"),
resources.GetString("cmblistenerType.Items2"),
resources.GetString("cmblistenerType.Items3"),
resources.GetString("cmblistenerType.Items4"),
resources.GetString("cmblistenerType.Items5"),
resources.GetString("cmblistenerType.Items6")});
this.cmblistenerType.Name = "cmblistenerType";
//
// chksniffingEnabled2
//
resources.ApplyResources(this.chksniffingEnabled2, "chksniffingEnabled2");
@ -209,16 +156,6 @@
this.chksniffingEnabled.Name = "chksniffingEnabled";
this.chksniffingEnabled.UseVisualStyleBackColor = true;
//
// txtremoteDNS
//
resources.ApplyResources(this.txtremoteDNS, "txtremoteDNS");
this.txtremoteDNS.Name = "txtremoteDNS";
//
// label14
//
resources.ApplyResources(this.label14, "label14");
this.label14.Name = "label14";
//
// chkmuxEnabled
//
resources.ApplyResources(this.chkmuxEnabled, "chkmuxEnabled");
@ -240,12 +177,12 @@
//
// cmbprotocol2
//
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbprotocol2.FormattingEnabled = true;
this.cmbprotocol2.Items.AddRange(new object[] {
resources.GetString("cmbprotocol2.Items"),
resources.GetString("cmbprotocol2.Items1")});
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
this.cmbprotocol2.Name = "cmbprotocol2";
//
// label3
@ -260,8 +197,8 @@
//
// cmbprotocol
//
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
this.cmbprotocol.FormattingEnabled = true;
this.cmbprotocol.Items.AddRange(new object[] {
resources.GetString("cmbprotocol.Items"),
@ -287,7 +224,6 @@
//
// cmbloglevel
//
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbloglevel.FormattingEnabled = true;
this.cmbloglevel.Items.AddRange(new object[] {
@ -296,6 +232,7 @@
resources.GetString("cmbloglevel.Items2"),
resources.GetString("cmbloglevel.Items3"),
resources.GetString("cmbloglevel.Items4")});
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
this.cmbloglevel.Name = "cmbloglevel";
//
// label5
@ -315,127 +252,32 @@
//
// tabPage2
//
this.tabPage2.Controls.Add(this.linkDnsObjectDoc);
this.tabPage2.Controls.Add(this.txtremoteDNS);
this.tabPage2.Controls.Add(this.label14);
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Controls.Add(this.groupBox2);
this.tabPage2.Name = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// groupBox2
// linkDnsObjectDoc
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.tabControl2);
this.groupBox2.Controls.Add(this.panel3);
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
resources.ApplyResources(this.linkDnsObjectDoc, "linkDnsObjectDoc");
this.linkDnsObjectDoc.Name = "linkDnsObjectDoc";
this.linkDnsObjectDoc.TabStop = true;
this.linkDnsObjectDoc.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkDnsObjectDoc_LinkClicked);
//
// tabControl2
// txtremoteDNS
//
resources.ApplyResources(this.tabControl2, "tabControl2");
this.tabControl2.Controls.Add(this.tabPage3);
this.tabControl2.Controls.Add(this.tabPage4);
this.tabControl2.Controls.Add(this.tabPage5);
this.tabControl2.Controls.Add(this.tabPage8);
this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0;
resources.ApplyResources(this.txtremoteDNS, "txtremoteDNS");
this.txtremoteDNS.Name = "txtremoteDNS";
//
// tabPage3
// label14
//
resources.ApplyResources(this.tabPage3, "tabPage3");
this.tabPage3.Controls.Add(this.txtUseragent);
this.tabPage3.Name = "tabPage3";
this.tabPage3.UseVisualStyleBackColor = true;
//
// txtUseragent
//
resources.ApplyResources(this.txtUseragent, "txtUseragent");
this.txtUseragent.Name = "txtUseragent";
//
// tabPage4
//
resources.ApplyResources(this.tabPage4, "tabPage4");
this.tabPage4.Controls.Add(this.txtUserdirect);
this.tabPage4.Name = "tabPage4";
this.tabPage4.UseVisualStyleBackColor = true;
//
// txtUserdirect
//
resources.ApplyResources(this.txtUserdirect, "txtUserdirect");
this.txtUserdirect.Name = "txtUserdirect";
//
// tabPage5
//
resources.ApplyResources(this.tabPage5, "tabPage5");
this.tabPage5.Controls.Add(this.txtUserblock);
this.tabPage5.Name = "tabPage5";
this.tabPage5.UseVisualStyleBackColor = true;
//
// txtUserblock
//
resources.ApplyResources(this.txtUserblock, "txtUserblock");
this.txtUserblock.Name = "txtUserblock";
//
// tabPage8
//
resources.ApplyResources(this.tabPage8, "tabPage8");
this.tabPage8.Controls.Add(this.cmbroutingMode);
this.tabPage8.Name = "tabPage8";
this.tabPage8.UseVisualStyleBackColor = true;
//
// cmbroutingMode
//
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbroutingMode.FormattingEnabled = true;
this.cmbroutingMode.Items.AddRange(new object[] {
resources.GetString("cmbroutingMode.Items"),
resources.GetString("cmbroutingMode.Items1"),
resources.GetString("cmbroutingMode.Items2"),
resources.GetString("cmbroutingMode.Items3")});
this.cmbroutingMode.Name = "cmbroutingMode";
//
// panel3
//
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Controls.Add(this.linkLabelRoutingDoc);
this.panel3.Controls.Add(this.btnSetDefRountingRule);
this.panel3.Controls.Add(this.labRoutingTips);
this.panel3.Controls.Add(this.cmbdomainStrategy);
this.panel3.Name = "panel3";
//
// linkLabelRoutingDoc
//
resources.ApplyResources(this.linkLabelRoutingDoc, "linkLabelRoutingDoc");
this.linkLabelRoutingDoc.Name = "linkLabelRoutingDoc";
this.linkLabelRoutingDoc.TabStop = true;
this.linkLabelRoutingDoc.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelRoutingDoc_LinkClicked);
//
// btnSetDefRountingRule
//
resources.ApplyResources(this.btnSetDefRountingRule, "btnSetDefRountingRule");
this.btnSetDefRountingRule.Name = "btnSetDefRountingRule";
this.btnSetDefRountingRule.UseVisualStyleBackColor = true;
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";
//
// cmbdomainStrategy
//
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainStrategy.FormattingEnabled = true;
this.cmbdomainStrategy.Items.AddRange(new object[] {
resources.GetString("cmbdomainStrategy.Items"),
resources.GetString("cmbdomainStrategy.Items1"),
resources.GetString("cmbdomainStrategy.Items2")});
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
resources.ApplyResources(this.label14, "label14");
this.label14.Name = "label14";
//
// tabPage6
//
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Controls.Add(this.chkKcpcongestion);
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
this.tabPage6.Controls.Add(this.label10);
@ -449,6 +291,7 @@
this.tabPage6.Controls.Add(this.label7);
this.tabPage6.Controls.Add(this.txtKcpmtu);
this.tabPage6.Controls.Add(this.label6);
resources.ApplyResources(this.tabPage6, "tabPage6");
this.tabPage6.Name = "tabPage6";
this.tabPage6.UseVisualStyleBackColor = true;
//
@ -520,18 +363,40 @@
//
// tabPage7
//
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Controls.Add(this.chkIgnoreGeoUpdateCore);
this.tabPage7.Controls.Add(this.cmbCoreType);
this.tabPage7.Controls.Add(this.label4);
this.tabPage7.Controls.Add(this.chkKeepOlderDedupl);
this.tabPage7.Controls.Add(this.cbFreshrate);
this.tabPage7.Controls.Add(this.lbFreshrate);
this.tabPage7.Controls.Add(this.chkEnableStatistics);
this.tabPage7.Controls.Add(this.chkAllowLANConn);
this.tabPage7.Controls.Add(this.txturlGFWList);
this.tabPage7.Controls.Add(this.label13);
this.tabPage7.Controls.Add(this.chkAutoRun);
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Name = "tabPage7";
this.tabPage7.UseVisualStyleBackColor = true;
//
// chkIgnoreGeoUpdateCore
//
resources.ApplyResources(this.chkIgnoreGeoUpdateCore, "chkIgnoreGeoUpdateCore");
this.chkIgnoreGeoUpdateCore.Name = "chkIgnoreGeoUpdateCore";
this.chkIgnoreGeoUpdateCore.UseVisualStyleBackColor = true;
//
// cmbCoreType
//
this.cmbCoreType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCoreType.FormattingEnabled = true;
this.cmbCoreType.Items.AddRange(new object[] {
resources.GetString("cmbCoreType.Items"),
resources.GetString("cmbCoreType.Items1")});
resources.ApplyResources(this.cmbCoreType, "cmbCoreType");
this.cmbCoreType.Name = "cmbCoreType";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// chkKeepOlderDedupl
//
resources.ApplyResources(this.chkKeepOlderDedupl, "chkKeepOlderDedupl");
@ -540,9 +405,9 @@
//
// cbFreshrate
//
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbFreshrate.FormattingEnabled = true;
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
this.cbFreshrate.Name = "cbFreshrate";
//
// lbFreshrate
@ -562,52 +427,17 @@
this.chkAllowLANConn.Name = "chkAllowLANConn";
this.chkAllowLANConn.UseVisualStyleBackColor = true;
//
// txturlGFWList
//
resources.ApplyResources(this.txturlGFWList, "txturlGFWList");
this.txturlGFWList.Name = "txturlGFWList";
//
// label13
//
resources.ApplyResources(this.label13, "label13");
this.label13.Name = "label13";
//
// chkAutoRun
//
resources.ApplyResources(this.chkAutoRun, "chkAutoRun");
this.chkAutoRun.Name = "chkAutoRun";
this.chkAutoRun.UseVisualStyleBackColor = true;
//
// tabPage9
//
resources.ApplyResources(this.tabPage9, "tabPage9");
this.tabPage9.Controls.Add(this.txtuserPacRule);
this.tabPage9.Controls.Add(this.panel4);
this.tabPage9.Name = "tabPage9";
this.tabPage9.UseVisualStyleBackColor = true;
//
// txtuserPacRule
//
resources.ApplyResources(this.txtuserPacRule, "txtuserPacRule");
this.txtuserPacRule.Name = "txtuserPacRule";
//
// panel4
//
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.label4);
this.panel4.Name = "panel4";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.ForeColor = System.Drawing.Color.Brown;
this.label4.Name = "label4";
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// btnOK
@ -638,24 +468,11 @@
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.tabControl2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
this.tabPage5.ResumeLayout(false);
this.tabPage5.PerformLayout();
this.tabPage8.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.tabPage2.PerformLayout();
this.tabPage6.ResumeLayout(false);
this.tabPage6.PerformLayout();
this.tabPage7.ResumeLayout(false);
this.tabPage7.PerformLayout();
this.tabPage9.ResumeLayout(false);
this.tabPage9.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);
@ -675,9 +492,7 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.ComboBox cmbprotocol;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cmbprotocol2;
@ -686,14 +501,6 @@
private System.Windows.Forms.CheckBox chkudpEnabled2;
private System.Windows.Forms.CheckBox chkAllowIn2;
private System.Windows.Forms.CheckBox chkmuxEnabled;
private System.Windows.Forms.TabControl tabControl2;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.Label labRoutingTips;
private System.Windows.Forms.TextBox txtUseragent;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.TextBox txtUserdirect;
private System.Windows.Forms.TextBox txtUserblock;
private System.Windows.Forms.TabPage tabPage6;
private System.Windows.Forms.TextBox txtKcpmtu;
private System.Windows.Forms.Label label6;
@ -710,29 +517,20 @@
private System.Windows.Forms.CheckBox chkKcpcongestion;
private System.Windows.Forms.TabPage tabPage7;
private System.Windows.Forms.CheckBox chkAutoRun;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox txturlGFWList;
private System.Windows.Forms.CheckBox chkAllowLANConn;
private System.Windows.Forms.TextBox txtremoteDNS;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.ComboBox cmbdomainStrategy;
private System.Windows.Forms.ComboBox cmbroutingMode;
private System.Windows.Forms.CheckBox chksniffingEnabled;
private System.Windows.Forms.CheckBox chksniffingEnabled2;
private System.Windows.Forms.Button btnSetDefRountingRule;
private System.Windows.Forms.CheckBox chkEnableStatistics;
private System.Windows.Forms.ComboBox cbFreshrate;
private System.Windows.Forms.Label lbFreshrate;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.ComboBox cmblistenerType;
private System.Windows.Forms.TabPage tabPage8;
private System.Windows.Forms.TabPage tabPage9;
private System.Windows.Forms.TextBox txtuserPacRule;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.CheckBox chkKeepOlderDedupl;
private System.Windows.Forms.LinkLabel linkLabelRoutingDoc;
private System.Windows.Forms.CheckBox chkdefAllowInsecure;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.LinkLabel linkDnsObjectDoc;
private System.Windows.Forms.TextBox txtremoteDNS;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.ComboBox cmbCoreType;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.CheckBox chkIgnoreGeoUpdateCore;
}
}

View file

@ -4,6 +4,7 @@ using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Base;
using v2rayN.HttpProxyHandler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
@ -18,13 +19,9 @@ namespace v2rayN.Forms
{
InitBase();
InitRouting();
InitKCP();
InitGUI();
InitUserPAC();
}
/// <summary>
@ -68,25 +65,10 @@ namespace v2rayN.Forms
//remoteDNS
txtremoteDNS.Text = config.remoteDNS;
cmblistenerType.SelectedIndex = (int)config.listenerType;
chkdefAllowInsecure.Checked = config.defAllowInsecure;
}
/// <summary>
/// 初始化路由设置
/// </summary>
private void InitRouting()
{
//路由
cmbdomainStrategy.Text = config.domainStrategy;
int.TryParse(config.routingMode, out int routingMode);
cmbroutingMode.SelectedIndex = routingMode;
txtUseragent.Text = Utils.List2String(config.useragent, true);
txtUserdirect.Text = Utils.List2String(config.userdirect, true);
txtUserblock.Text = Utils.List2String(config.userblock, true);
}
/// <summary>
/// 初始化KCP设置
@ -110,16 +92,10 @@ namespace v2rayN.Forms
//开机自动启动
chkAutoRun.Checked = Utils.IsAutoRun();
//自定义GFWList
txturlGFWList.Text = config.urlGFWList;
chkAllowLANConn.Checked = config.allowLANConn;
chkEnableStatistics.Checked = config.enableStatistics;
chkKeepOlderDedupl.Checked = config.keepOlderDedupl;
ComboItem[] cbSource = new ComboItem[]
{
new ComboItem{ID = (int)Global.StatisticsFreshRate.quick, Text = UIRes.I18N("QuickFresh")},
@ -144,13 +120,9 @@ namespace v2rayN.Forms
break;
}
chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore;
cmbCoreType.SelectedIndex = (int)config.coreType;
}
private void InitUserPAC()
{
txtuserPacRule.Text = Utils.List2String(config.userPacRule, true);
}
private void btnOK_Click(object sender, EventArgs e)
{
if (SaveBase() != 0)
@ -158,10 +130,6 @@ namespace v2rayN.Forms
return;
}
if (SaveRouting() != 0)
{
return;
}
if (SaveKCP() != 0)
{
@ -173,11 +141,6 @@ namespace v2rayN.Forms
return;
}
if (SaveUserPAC() != 0)
{
return;
}
if (ConfigHandler.SaveConfig(ref config) == 0)
{
this.DialogResult = DialogResult.OK;
@ -265,36 +228,12 @@ namespace v2rayN.Forms
//remoteDNS
config.remoteDNS = txtremoteDNS.Text.TrimEx();
config.listenerType = (ListenerType)Enum.ToObject(typeof(ListenerType), cmblistenerType.SelectedIndex);
config.defAllowInsecure = chkdefAllowInsecure.Checked;
return 0;
}
/// <summary>
/// 保存路由设置
/// </summary>
/// <returns></returns>
private int SaveRouting()
{
//路由
string domainStrategy = cmbdomainStrategy.Text;
string routingMode = cmbroutingMode.SelectedIndex.ToString();
string useragent = txtUseragent.Text.TrimEx();
string userdirect = txtUserdirect.Text.TrimEx();
string userblock = txtUserblock.Text.TrimEx();
config.domainStrategy = domainStrategy;
config.routingMode = routingMode;
config.useragent = Utils.String2List(useragent);
config.userdirect = Utils.String2List(userdirect);
config.userblock = Utils.String2List(userblock);
return 0;
}
/// <summary>
/// 保存KCP设置
@ -340,9 +279,6 @@ namespace v2rayN.Forms
//开机自动启动
Utils.SetAutoRun(chkAutoRun.Checked);
//自定义GFWList
config.urlGFWList = txturlGFWList.Text.TrimEx();
config.allowLANConn = chkAllowLANConn.Checked;
bool lastEnableStatistics = config.enableStatistics;
@ -350,27 +286,12 @@ namespace v2rayN.Forms
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue;
config.keepOlderDedupl = chkKeepOlderDedupl.Checked;
//if(lastEnableStatistics != config.enableStatistics)
//{
// /// https://stackoverflow.com/questions/779405/how-do-i-restart-my-c-sharp-winform-application
// // Shut down the current app instance.
// Application.Exit();
// // Restart the app passing "/restart [processId]" as cmd line args
// Process.Start(Application.ExecutablePath, "/restart " + Process.GetCurrentProcess().Id);
//}
return 0;
}
private int SaveUserPAC()
{
string userPacRule = txtuserPacRule.Text.TrimEx();
userPacRule = userPacRule.Replace("\"", "");
config.userPacRule = Utils.String2List(userPacRule);
config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked;
config.coreType = (ECoreType)cmbCoreType.SelectedIndex;
return 0;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
@ -388,75 +309,9 @@ namespace v2rayN.Forms
chkudpEnabled2.Enabled = blAllow2;
}
private void btnSetDefRountingRule_Click(object sender, EventArgs e)
private void linkDnsObjectDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
txtUseragent.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.agentTag);
txtUserdirect.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.directTag);
txtUserblock.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.blockTag);
cmbroutingMode.SelectedIndex = 3;
List<string> lstUrl = new List<string>
{
Global.CustomRoutingListUrl + Global.agentTag,
Global.CustomRoutingListUrl + Global.directTag,
Global.CustomRoutingListUrl + Global.blockTag
};
List<TextBox> lstTxt = new List<TextBox>
{
txtUseragent,
txtUserdirect,
txtUserblock
};
for (int k = 0; k < lstUrl.Count; k++)
{
TextBox txt = lstTxt[k];
DownloadHandle downloadHandle = new DownloadHandle();
downloadHandle.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
string result = args.Msg;
if (Utils.IsNullOrEmpty(result))
{
return;
}
txt.Text = result;
}
else
{
AppendText(false, args.Msg);
}
};
downloadHandle.Error += (sender2, args) =>
{
AppendText(true, args.GetException().Message);
};
downloadHandle.WebDownloadString(lstUrl[k]);
}
}
void AppendText(bool notify, string text)
{
labRoutingTips.Text = text;
}
private void linkLabelRoutingDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://www.v2fly.org/config/routing.html");
}
}
class ComboItem
{
public int ID
{
get; set;
}
public string Text
{
get; set;
System.Diagnostics.Process.Start("https://www.v2fly.org/config/dns.html#dnsobject");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -120,43 +120,13 @@
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="chkdefAllowInsecure.Size" type="System.Drawing.Size, System.Drawing">
<value>222, 16</value>
<value>336, 16</value>
</data>
<data name="chkdefAllowInsecure.Text" xml:space="preserve">
<value>底层传输安全选tls时默认跳过证书验证(allowInsecure)</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label16.Text" xml:space="preserve">
<value>Http代理</value>
</data>
<data name="cmblistenerType.Items" xml:space="preserve">
<value>关闭Http代理</value>
</data>
<data name="cmblistenerType.Items1" xml:space="preserve">
<value>开启Http代理,并自动配置系统代理(全局模式)</value>
</data>
<data name="cmblistenerType.Items2" xml:space="preserve">
<value>开启PAC,并自动配置系统代理(PAC模式)</value>
</data>
<data name="cmblistenerType.Items3" xml:space="preserve">
<value>仅开启Http代理,并清除系统代理</value>
</data>
<data name="cmblistenerType.Items4" xml:space="preserve">
<value>仅开启PAC,并清除系统代理</value>
</data>
<data name="cmblistenerType.Items5" xml:space="preserve">
<value>仅开启Http代理,不改变系统代理</value>
</data>
<data name="cmblistenerType.Items6" xml:space="preserve">
<value>仅开启PAC,不改变系统代理</value>
</data>
<data name="chksniffingEnabled2.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 16</value>
</data>
@ -169,12 +139,6 @@
<data name="chksniffingEnabled.Text" xml:space="preserve">
<value>开启流量探测</value>
</data>
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
<value>191, 12</value>
</data>
<data name="label14.Text" xml:space="preserve">
<value>自定义DNS(可多个,用逗号(,)隔开)</value>
</data>
<data name="chkmuxEnabled.Text" xml:space="preserve">
<value>开启Mux多路复用(默认开启)</value>
</data>
@ -226,106 +190,50 @@
<data name="label2.Text" xml:space="preserve">
<value>本地监听端口</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>648, 437</value>
</data>
<data name="tabPage1.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>161, 12</value>
</data>
<data name="linkDnsObjectDoc.Text" xml:space="preserve">
<value>支持填写DnsObject,JSON格式</value>
</data>
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
<value>191, 12</value>
</data>
<data name="label14.Text" xml:space="preserve">
<value>自定义DNS(可多个,用逗号(,)隔开)</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value> Core:路由设置 </value>
<value> Core:DNS设置 </value>
</data>
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 89</value>
</data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value>642, 481</value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value> 1.代理的Domain或IP </value>
</data>
<data name="txtUseragent.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
</data>
<data name="tabPage4.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
</data>
<data name="tabPage4.Text" xml:space="preserve">
<value> 2.直连的Domain或IP </value>
</data>
<data name="txtUserdirect.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
</data>
<data name="tabPage5.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
</data>
<data name="tabPage5.Text" xml:space="preserve">
<value> 3.阻止的Domain或IP </value>
</data>
<data name="txtUserblock.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
</data>
<data name="tabPage8.Size" type="System.Drawing.Size, System.Drawing">
<value>634, 455</value>
</data>
<data name="tabPage8.Text" xml:space="preserve">
<value> 4.预定义规则 </value>
</data>
<data name="cmbroutingMode.Items" xml:space="preserve">
<value>全局</value>
</data>
<data name="cmbroutingMode.Items1" xml:space="preserve">
<value>绕过局域网地址</value>
</data>
<data name="cmbroutingMode.Items2" xml:space="preserve">
<value>绕过大陆地址</value>
</data>
<data name="cmbroutingMode.Items3" xml:space="preserve">
<value>绕过局域网及大陆地址</value>
</data>
<data name="cmbroutingMode.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 26</value>
</data>
<data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing">
<value>244, 20</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>642, 72</value>
</data>
<data name="linkLabelRoutingDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
</data>
<data name="linkLabelRoutingDoc.Text" xml:space="preserve">
<value>域名解析策略</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnSetDefRountingRule.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
<value>351, 14</value>
</data>
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>201, 23</value>
</data>
<data name="btnSetDefRountingRule.Text" xml:space="preserve">
<value>一键设置默认自定义路由规则</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 49</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>383, 12</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value>
<data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage6.Text" xml:space="preserve">
<value> Core:KCP设置 </value>
</data>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
<data name="chkIgnoreGeoUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>150, 16</value>
</data>
<data name="chkIgnoreGeoUpdateCore.Text" xml:space="preserve">
<value>更新Core时忽略Geo文件</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>Core类型</value>
</data>
<data name="chkKeepOlderDedupl.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 16</value>
@ -351,27 +259,30 @@
<data name="chkAllowLANConn.Text" xml:space="preserve">
<value>允许来自局域网的连接</value>
</data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 12</value>
</data>
<data name="label13.Text" xml:space="preserve">
<value>自定义GFWList地址(不需自定义请填空白)</value>
</data>
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 16</value>
</data>
<data name="chkAutoRun.Text" xml:space="preserve">
<value>开机自动启动(可能会不成功)</value>
</data>
<data name="tabPage9.Text" xml:space="preserve">
<value> 用户PAC设置 </value>
<data name="tabPage7.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>*设置用户PAC规则用逗号(,)隔开</value>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
</data>
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 469</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 479</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>662, 539</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>参数设置</value>
</data>

View file

@ -24,7 +24,7 @@ namespace v2rayN.Forms
{
if (Index >= 0)
{
string url = ConfigHandler.GetVmessQRCode(config, Index);
string url = ShareHandler.GetShareUrl(config, Index);
if (Utils.IsNullOrEmpty(url))
{
picQRCode.Image = null;

View file

@ -0,0 +1,170 @@
namespace v2rayN.Forms
{
partial class RoutingRuleQuicklyAddForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingRuleQuicklyAddForm));
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.label4 = new System.Windows.Forms.Label();
this.cmbOutboundTag = new System.Windows.Forms.ComboBox();
this.panel4 = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtIP = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtDomain = new System.Windows.Forms.TextBox();
this.panel3.SuspendLayout();
this.panel4.SuspendLayout();
this.panel2.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// panel3
//
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Controls.Add(this.label4);
this.panel3.Controls.Add(this.cmbOutboundTag);
this.panel3.Name = "panel3";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// cmbOutboundTag
//
resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag");
this.cmbOutboundTag.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbOutboundTag.FormattingEnabled = true;
this.cmbOutboundTag.Items.AddRange(new object[] {
resources.GetString("cmbOutboundTag.Items"),
resources.GetString("cmbOutboundTag.Items1"),
resources.GetString("cmbOutboundTag.Items2")});
this.cmbOutboundTag.Name = "cmbOutboundTag";
//
// panel4
//
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.btnClose);
this.panel4.Controls.Add(this.btnOK);
this.panel4.Name = "panel4";
//
// btnClose
//
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.groupBox2);
this.panel2.Controls.Add(this.groupBox1);
this.panel2.Name = "panel2";
//
// groupBox2
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.txtIP);
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// txtIP
//
resources.ApplyResources(this.txtIP, "txtIP");
this.txtIP.Name = "txtIP";
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.txtDomain);
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// txtDomain
//
resources.ApplyResources(this.txtDomain, "txtDomain");
this.txtDomain.Name = "txtDomain";
//
// RoutingRuleQuicklyAddForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel4);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel1);
this.Name = "RoutingRuleQuicklyAddForm";
this.Load += new System.EventHandler(this.RoutingRuleQuicklyAddForm_Load);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox cmbOutboundTag;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtDomain;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtIP;
}
}

View file

@ -0,0 +1,73 @@
using System;
using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingRuleQuicklyAddForm : BaseForm
{
public string domain
{
get; set;
}
private RulesItem rulesItem;
public RoutingRuleQuicklyAddForm()
{
InitializeComponent();
}
private void RoutingRuleQuicklyAddForm_Load(object sender, EventArgs e)
{
rulesItem = new RulesItem();
ClearBind();
}
private void EndBindingData()
{
if (rulesItem != null)
{
rulesItem.outboundTag = cmbOutboundTag.Text;
rulesItem.domain = Utils.String2List(txtDomain.Text);
rulesItem.ip = Utils.String2List(txtIP.Text);
}
}
private void ClearBind()
{
cmbOutboundTag.Text = Global.agentTag;
txtDomain.Text = domain;
}
private void btnOK_Click(object sender, EventArgs e)
{
EndBindingData();
var hasRule = false;
if (rulesItem.domain != null && rulesItem.domain.Count > 0)
{
hasRule = true;
}
if (rulesItem.ip != null && rulesItem.ip.Count > 0)
{
hasRule = true;
}
if (!hasRule)
{
return;
}
if (ConfigHandler.InsertRoutingRuleItem(ref config, rulesItem) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -0,0 +1,462 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="&gt;&gt;txtIP.Name" xml:space="preserve">
<value>txtIP</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel3.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cmbOutboundTag.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 20</value>
</data>
<data name="&gt;&gt;panel4.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtDomain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtIP.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 207</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel4.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingRuleQuicklyAddForm</value>
</data>
<data name="&gt;&gt;panel4.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="panel4.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 288</value>
</data>
<data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="txtIP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="cmbOutboundTag.Items" xml:space="preserve">
<value>proxy</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Left</value>
</data>
<data name="txtDomain.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>506, 10</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;txtIP.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Domain</value>
</data>
<data name="&gt;&gt;txtDomain.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="panel3.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel3.Name" xml:space="preserve">
<value>panel3</value>
</data>
<data name="cmbOutboundTag.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>506, 51</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;txtDomain.Name" xml:space="preserve">
<value>txtDomain</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="&gt;&gt;panel4.Name" xml:space="preserve">
<value>panel4</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>IP</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>280, 0</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="txtIP.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>outboundTag</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="cmbOutboundTag.Items2" xml:space="preserve">
<value>block</value>
</data>
<data name="cmbOutboundTag.Items1" xml:space="preserve">
<value>direct</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;panel3.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>305, 25</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>506, 227</value>
</data>
<data name="txtDomain.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>280, 227</value>
</data>
<data name="&gt;&gt;txtDomain.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Name" xml:space="preserve">
<value>cmbOutboundTag</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>506, 60</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;groupBox2.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>226, 227</value>
</data>
<data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>107, 16</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>RoutingRuleQuicklyAddForm</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;groupBox2.Name" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 20</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;txtIP.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;panel3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 61</value>
</data>
<data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;panel4.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>274, 207</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>506, 348</value>
</data>
<data name="txtIP.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;groupBox2.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>398, 25</value>
</data>
<data name="txtIP.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;panel3.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>zh-Hans</value>
</metadata>
</root>

View file

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="label4.Text" xml:space="preserve">
<value>OutboundTag</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>快速添加路由规则</value>
</data>
</root>

View file

@ -0,0 +1,218 @@
namespace v2rayN.Forms
{
partial class RoutingRuleSettingDetailsForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingRuleSettingDetailsForm));
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.clbProtocol = new System.Windows.Forms.CheckedListBox();
this.label3 = new System.Windows.Forms.Label();
this.txtPort = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.labRoutingTips = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.cmbOutboundTag = new System.Windows.Forms.ComboBox();
this.panel4 = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtIP = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtDomain = new System.Windows.Forms.TextBox();
this.panel3.SuspendLayout();
this.panel4.SuspendLayout();
this.panel2.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// panel3
//
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Controls.Add(this.clbProtocol);
this.panel3.Controls.Add(this.label3);
this.panel3.Controls.Add(this.txtPort);
this.panel3.Controls.Add(this.label1);
this.panel3.Controls.Add(this.labRoutingTips);
this.panel3.Controls.Add(this.label4);
this.panel3.Controls.Add(this.cmbOutboundTag);
this.panel3.Name = "panel3";
//
// clbProtocol
//
resources.ApplyResources(this.clbProtocol, "clbProtocol");
this.clbProtocol.CheckOnClick = true;
this.clbProtocol.FormattingEnabled = true;
this.clbProtocol.Items.AddRange(new object[] {
resources.GetString("clbProtocol.Items"),
resources.GetString("clbProtocol.Items1"),
resources.GetString("clbProtocol.Items2")});
this.clbProtocol.MultiColumn = true;
this.clbProtocol.Name = "clbProtocol";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// txtPort
//
resources.ApplyResources(this.txtPort, "txtPort");
this.txtPort.Name = "txtPort";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// 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.Name = "label4";
//
// cmbOutboundTag
//
resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag");
this.cmbOutboundTag.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbOutboundTag.FormattingEnabled = true;
this.cmbOutboundTag.Items.AddRange(new object[] {
resources.GetString("cmbOutboundTag.Items"),
resources.GetString("cmbOutboundTag.Items1"),
resources.GetString("cmbOutboundTag.Items2")});
this.cmbOutboundTag.Name = "cmbOutboundTag";
//
// panel4
//
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Controls.Add(this.btnClose);
this.panel4.Controls.Add(this.btnOK);
this.panel4.Name = "panel4";
//
// btnClose
//
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Controls.Add(this.groupBox2);
this.panel2.Controls.Add(this.groupBox1);
this.panel2.Name = "panel2";
//
// groupBox2
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.txtIP);
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// txtIP
//
resources.ApplyResources(this.txtIP, "txtIP");
this.txtIP.Name = "txtIP";
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.txtDomain);
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// txtDomain
//
resources.ApplyResources(this.txtDomain, "txtDomain");
this.txtDomain.Name = "txtDomain";
//
// RoutingRuleSettingDetailsForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel4);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel1);
this.Name = "RoutingRuleSettingDetailsForm";
this.Load += new System.EventHandler(this.RoutingRuleSettingDetailsForm_Load);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox cmbOutboundTag;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtDomain;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtIP;
private System.Windows.Forms.Label labRoutingTips;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtPort;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckedListBox clbProtocol;
}
}

View file

@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingRuleSettingDetailsForm : BaseForm
{
public RulesItem rulesItem
{
get; set;
}
public RoutingRuleSettingDetailsForm()
{
InitializeComponent();
}
private void RoutingRuleSettingDetailsForm_Load(object sender, EventArgs e)
{
if (Utils.IsNullOrEmpty(rulesItem.outboundTag))
{
ClearBind();
}
else
{
BindingData();
}
}
private void EndBindingData()
{
if (rulesItem != null)
{
rulesItem.port = txtPort.Text.TrimEx();
rulesItem.outboundTag = cmbOutboundTag.Text;
rulesItem.domain = Utils.String2List(txtDomain.Text);
rulesItem.ip = Utils.String2List(txtIP.Text);
var protocol = new List<string>();
for (int i = 0; i < clbProtocol.Items.Count; i++)
{
if (clbProtocol.GetItemChecked(i))
{
protocol.Add(clbProtocol.Items[i].ToString());
}
}
rulesItem.protocol = protocol;
}
}
private void BindingData()
{
if (rulesItem != null)
{
txtPort.Text = rulesItem.port ?? string.Empty;
cmbOutboundTag.Text = rulesItem.outboundTag;
txtDomain.Text = Utils.List2String(rulesItem.domain, true);
txtIP.Text = Utils.List2String(rulesItem.ip, true);
if (rulesItem.protocol != null)
{
for (int i = 0; i < clbProtocol.Items.Count; i++)
{
if (rulesItem.protocol.Contains(clbProtocol.Items[i].ToString()))
{
clbProtocol.SetItemChecked(i, true);
}
}
}
}
}
private void ClearBind()
{
txtPort.Text = string.Empty;
cmbOutboundTag.Text = Global.agentTag;
txtDomain.Text = string.Empty;
txtIP.Text = string.Empty;
}
private void btnOK_Click(object sender, EventArgs e)
{
EndBindingData();
var hasRule = false;
if (rulesItem.domain != null && rulesItem.domain.Count > 0)
{
hasRule = true;
}
if (rulesItem.ip != null && rulesItem.ip.Count > 0)
{
hasRule = true;
}
if (rulesItem.protocol != null && rulesItem.protocol.Count > 0)
{
hasRule = true;
}
if (!Utils.IsNullOrEmpty(rulesItem.port))
{
hasRule = true;
}
if (!hasRule)
{
UI.ShowWarning(string.Format(UIRes.I18N("RoutingRuleDetailRequiredTips"), "Port/Protocol/Domain/IP"));
return;
}
this.DialogResult = DialogResult.OK;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -0,0 +1,603 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="clbProtocol.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 20</value>
</data>
<data name="cmbOutboundTag.Items1" xml:space="preserve">
<value>direct</value>
</data>
<data name="cmbOutboundTag.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="cmbOutboundTag.Items" xml:space="preserve">
<value>proxy</value>
</data>
<data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>107, 16</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;clbProtocol.Name" xml:space="preserve">
<value>clbProtocol</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labRoutingTips.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="txtDomain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="&gt;&gt;clbProtocol.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Left</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>742, 576</value>
</data>
<data name="&gt;&gt;groupBox2.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="clbProtocol.Items1" xml:space="preserve">
<value>tls</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>RoutingSettingDetailsForm</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="txtIP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>411, 15</value>
</data>
<data name="cmbOutboundTag.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 20</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>36</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtIP.Size" type="System.Drawing.Size, System.Drawing">
<value>344, 375</value>
</data>
<data name="&gt;&gt;panel3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>598, 16</value>
</data>
<data name="&gt;&gt;txtDomain.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="labRoutingTips.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 121</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 395</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Protocol</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="&gt;&gt;panel3.Name" xml:space="preserve">
<value>panel3</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="clbProtocol.Items2" xml:space="preserve">
<value>bittorrent</value>
</data>
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 82</value>
</data>
<data name="txtIP.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;labRoutingTips.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 20</value>
</data>
<data name="&gt;&gt;labRoutingTips.Name" xml:space="preserve">
<value>labRoutingTips</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 47</value>
</data>
<data name="clbProtocol.TabIndex" type="System.Int32, mscorlib">
<value>39</value>
</data>
<data name="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingRuleSettingDetailsForm</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtPort.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>107, 43</value>
</data>
<data name="&gt;&gt;groupBox2.Name" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="txtDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 375</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>392, 0</value>
</data>
<data name="panel3.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel4.Name" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;clbProtocol.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;txtIP.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;panel4.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtIP.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="clbProtocol.Items" xml:space="preserve">
<value>http</value>
</data>
<data name="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</value>
</data>
<data name="txtIP.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="&gt;&gt;panel4.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 10</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="txtDomain.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;labRoutingTips.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>274, 47</value>
</data>
<data name="cmbOutboundTag.Items2" xml:space="preserve">
<value>block</value>
</data>
<data name="labRoutingTips.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="clbProtocol.Location" type="System.Drawing.Point, System.Drawing">
<value>347, 43</value>
</data>
<data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;groupBox2.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;panel3.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 21</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;clbProtocol.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="panel3.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="clbProtocol.ColumnWidth" type="System.Int32, mscorlib">
<value>80</value>
</data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 60</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel4.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*Set the rules, separated by commas (,); The comma in the regular is replaced by &lt;COMMA&gt;</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 111</value>
</data>
<data name="txtIP.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Port</value>
</data>
<data name="&gt;&gt;txtPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtDomain.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtIP.Name" xml:space="preserve">
<value>txtIP</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Name" xml:space="preserve">
<value>cmbOutboundTag</value>
</data>
<data name="txtDomain.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Domain</value>
</data>
<data name="panel4.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 395</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;txtDomain.Name" xml:space="preserve">
<value>txtDomain</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>IP</value>
</data>
<data name="&gt;&gt;panel3.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panel4.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 516</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>350, 395</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>504, 15</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>outboundTag</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>zh-Hans</value>
</metadata>
</root>

View file

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的路由规则,用逗号(,)分隔;正则中的逗号用&lt;COMMA&gt;替代</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>OutboundTag</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="txtIP.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Vertical</value>
</data>
<data name="txtDomain.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Vertical</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>路由规则详情设置</value>
</data>
</root>

View file

@ -0,0 +1,323 @@
namespace v2rayN.Forms
{
partial class RoutingRuleSettingForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingRuleSettingForm));
this.btnClose = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.txtUrl = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.lvRoutings = new v2rayN.Base.ListViewFlickerFree();
this.cmsLv = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuAdd = new System.Windows.Forms.ToolStripMenuItem();
this.menuRemove = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuExportSelectedRules = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.menuMoveTop = new System.Windows.Forms.ToolStripMenuItem();
this.menuMoveUp = new System.Windows.Forms.ToolStripMenuItem();
this.menuMoveDown = new System.Windows.Forms.ToolStripMenuItem();
this.menuMoveBottom = new System.Windows.Forms.ToolStripMenuItem();
this.MenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.menuServer = new System.Windows.Forms.MenuStrip();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportRulesFromFile = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportRulesFromClipboard = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportRulesFromUrl = new System.Windows.Forms.ToolStripMenuItem();
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
this.cmsLv.SuspendLayout();
this.tabControl2.SuspendLayout();
this.tabPage2.SuspendLayout();
this.menuServer.SuspendLayout();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// panel2
//
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel1
//
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.txtUrl);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.txtRemarks);
this.panel1.Controls.Add(this.label2);
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// txtUrl
//
resources.ApplyResources(this.txtUrl, "txtUrl");
this.txtUrl.Name = "txtUrl";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// txtRemarks
//
resources.ApplyResources(this.txtRemarks, "txtRemarks");
this.txtRemarks.Name = "txtRemarks";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// lvRoutings
//
this.lvRoutings.ContextMenuStrip = this.cmsLv;
resources.ApplyResources(this.lvRoutings, "lvRoutings");
this.lvRoutings.FullRowSelect = true;
this.lvRoutings.GridLines = true;
this.lvRoutings.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.lvRoutings.HideSelection = false;
this.lvRoutings.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
((System.Windows.Forms.ListViewItem)(resources.GetObject("lvRoutings.Items")))});
this.lvRoutings.MultiSelect = false;
this.lvRoutings.Name = "lvRoutings";
this.lvRoutings.UseCompatibleStateImageBehavior = false;
this.lvRoutings.View = System.Windows.Forms.View.Details;
this.lvRoutings.DoubleClick += new System.EventHandler(this.lvRoutings_DoubleClick);
this.lvRoutings.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvRoutings_KeyDown);
//
// cmsLv
//
this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuAdd,
this.menuRemove,
this.menuSelectAll,
this.menuExportSelectedRules,
this.toolStripSeparator3,
this.menuMoveTop,
this.menuMoveUp,
this.menuMoveDown,
this.menuMoveBottom});
this.cmsLv.Name = "cmsLv";
this.cmsLv.OwnerItem = this.MenuItem1;
resources.ApplyResources(this.cmsLv, "cmsLv");
//
// menuAdd
//
this.menuAdd.Name = "menuAdd";
resources.ApplyResources(this.menuAdd, "menuAdd");
this.menuAdd.Click += new System.EventHandler(this.menuAdd_Click);
//
// menuRemove
//
this.menuRemove.Name = "menuRemove";
resources.ApplyResources(this.menuRemove, "menuRemove");
this.menuRemove.Click += new System.EventHandler(this.menuRemove_Click);
//
// menuSelectAll
//
this.menuSelectAll.Name = "menuSelectAll";
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
//
// menuExportSelectedRules
//
this.menuExportSelectedRules.Name = "menuExportSelectedRules";
resources.ApplyResources(this.menuExportSelectedRules, "menuExportSelectedRules");
this.menuExportSelectedRules.Click += new System.EventHandler(this.menuExportSelectedRules_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
//
// menuMoveTop
//
this.menuMoveTop.Name = "menuMoveTop";
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
this.menuMoveTop.Click += new System.EventHandler(this.menuMoveTop_Click);
//
// menuMoveUp
//
this.menuMoveUp.Name = "menuMoveUp";
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
this.menuMoveUp.Click += new System.EventHandler(this.menuMoveUp_Click);
//
// menuMoveDown
//
this.menuMoveDown.Name = "menuMoveDown";
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
this.menuMoveDown.Click += new System.EventHandler(this.menuMoveDown_Click);
//
// menuMoveBottom
//
this.menuMoveBottom.Name = "menuMoveBottom";
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
this.menuMoveBottom.Click += new System.EventHandler(this.menuMoveBottom_Click);
//
// MenuItem1
//
this.MenuItem1.DropDown = this.cmsLv;
this.MenuItem1.Name = "MenuItem1";
resources.ApplyResources(this.MenuItem1, "MenuItem1");
//
// tabControl2
//
this.tabControl2.Controls.Add(this.tabPage2);
resources.ApplyResources(this.tabControl2, "tabControl2");
this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.lvRoutings);
resources.ApplyResources(this.tabPage2, "tabPage2");
this.tabPage2.Name = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// menuServer
//
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItem1,
this.toolStripMenuItem1});
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Name = "menuServer";
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuImportRulesFromFile,
this.menuImportRulesFromClipboard,
this.menuImportRulesFromUrl});
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1");
//
// menuImportRulesFromFile
//
this.menuImportRulesFromFile.Name = "menuImportRulesFromFile";
resources.ApplyResources(this.menuImportRulesFromFile, "menuImportRulesFromFile");
this.menuImportRulesFromFile.Click += new System.EventHandler(this.menuImportRulesFromFile_Click);
//
// menuImportRulesFromClipboard
//
this.menuImportRulesFromClipboard.Name = "menuImportRulesFromClipboard";
resources.ApplyResources(this.menuImportRulesFromClipboard, "menuImportRulesFromClipboard");
this.menuImportRulesFromClipboard.Click += new System.EventHandler(this.menuImportRulesFromClipboard_Click);
//
// menuImportRulesFromUrl
//
this.menuImportRulesFromUrl.Name = "menuImportRulesFromUrl";
resources.ApplyResources(this.menuImportRulesFromUrl, "menuImportRulesFromUrl");
this.menuImportRulesFromUrl.Click += new System.EventHandler(this.menuImportRulesFromUrl_Click);
//
// RoutingRuleSettingForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.tabControl2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel2);
this.Controls.Add(this.menuServer);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "RoutingRuleSettingForm";
this.Load += new System.EventHandler(this.RoutingRuleSettingForm_Load);
this.panel2.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.cmsLv.ResumeLayout(false);
this.tabControl2.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.menuServer.ResumeLayout(false);
this.menuServer.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel1;
private Base.ListViewFlickerFree lvRoutings;
private System.Windows.Forms.TabControl tabControl2;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.ContextMenuStrip cmsLv;
private System.Windows.Forms.ToolStripMenuItem menuRemove;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem menuMoveTop;
private System.Windows.Forms.ToolStripMenuItem menuMoveUp;
private System.Windows.Forms.ToolStripMenuItem menuMoveDown;
private System.Windows.Forms.ToolStripMenuItem menuMoveBottom;
private System.Windows.Forms.ToolStripMenuItem menuSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuAdd;
private System.Windows.Forms.MenuStrip menuServer;
private System.Windows.Forms.ToolStripMenuItem MenuItem1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem menuImportRulesFromFile;
private System.Windows.Forms.ToolStripMenuItem menuImportRulesFromClipboard;
private System.Windows.Forms.ToolStripMenuItem menuExportSelectedRules;
private System.Windows.Forms.ToolStripMenuItem menuImportRulesFromUrl;
private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtUrl;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label1;
}
}

View file

@ -0,0 +1,334 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingRuleSettingForm : BaseForm
{
public int EditIndex
{
get; set;
}
protected RoutingItem routingItem = null;
private List<int> lvSelecteds = new List<int>();
public RoutingRuleSettingForm()
{
InitializeComponent();
}
private void RoutingRuleSettingForm_Load(object sender, EventArgs e)
{
if (EditIndex >= 0)
{
routingItem = config.routings[EditIndex];
}
else
{
routingItem = new RoutingItem();
}
if (routingItem.rules == null)
{
routingItem.rules = new List<RulesItem>();
}
txtRemarks.Text = routingItem.remarks ?? string.Empty;
txtUrl.Text = routingItem.url ?? string.Empty;
InitRoutingsView();
RefreshRoutingsView();
}
private void InitRoutingsView()
{
lvRoutings.BeginUpdate();
lvRoutings.Items.Clear();
lvRoutings.GridLines = true;
lvRoutings.FullRowSelect = true;
lvRoutings.View = View.Details;
lvRoutings.MultiSelect = true;
lvRoutings.HeaderStyle = ColumnHeaderStyle.Clickable;
lvRoutings.Columns.Add("", 30);
lvRoutings.Columns.Add("outboundTag", 80);
lvRoutings.Columns.Add("port", 80);
lvRoutings.Columns.Add("protocol", 100);
lvRoutings.Columns.Add("domain", 160);
lvRoutings.Columns.Add("ip", 160);
lvRoutings.EndUpdate();
}
private void RefreshRoutingsView()
{
lvRoutings.BeginUpdate();
lvRoutings.Items.Clear();
for (int k = 0; k < routingItem.rules.Count; k++)
{
var item = routingItem.rules[k];
ListViewItem lvItem = new ListViewItem("");
Utils.AddSubItem(lvItem, "outboundTag", item.outboundTag);
Utils.AddSubItem(lvItem, "port", item.port);
Utils.AddSubItem(lvItem, "protocol", Utils.List2String(item.protocol));
Utils.AddSubItem(lvItem, "domain", Utils.List2String(item.domain));
Utils.AddSubItem(lvItem, "ip", Utils.List2String(item.ip));
if (lvItem != null) lvRoutings.Items.Add(lvItem);
}
lvRoutings.EndUpdate();
}
private void btnOK_Click(object sender, EventArgs e)
{
routingItem.remarks = txtRemarks.Text.Trim();
routingItem.url = txtUrl.Text.Trim();
if (ConfigHandler.AddRoutingItem(ref config, routingItem, EditIndex) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
private void lvRoutings_DoubleClick(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
var fm = new RoutingRuleSettingDetailsForm();
fm.rulesItem = routingItem.rules[index];
if (fm.ShowDialog() == DialogResult.OK)
{
RefreshRoutingsView();
}
}
private int GetLvSelectedIndex()
{
int index = -1;
lvSelecteds.Clear();
try
{
if (lvRoutings.SelectedIndices.Count <= 0)
{
UI.Show(UIRes.I18N("PleaseSelectRules"));
return index;
}
index = lvRoutings.SelectedIndices[0];
foreach (int i in lvRoutings.SelectedIndices)
{
lvSelecteds.Add(i);
}
return index;
}
catch
{
return index;
}
}
#region Edit function
private void menuMoveTop_Click(object sender, EventArgs e)
{
MoveRule(EMove.Top);
}
private void menuMoveUp_Click(object sender, EventArgs e)
{
MoveRule(EMove.Up);
}
private void menuMoveDown_Click(object sender, EventArgs e)
{
MoveRule(EMove.Down);
}
private void menuMoveBottom_Click(object sender, EventArgs e)
{
MoveRule(EMove.Bottom);
}
private void MoveRule(EMove eMove)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
UI.Show(UIRes.I18N("PleaseSelectRules"));
return;
}
if (ConfigHandler.MoveRoutingRule(ref routingItem, index, eMove) == 0)
{
RefreshRoutingsView();
}
}
private void menuSelectAll_Click(object sender, EventArgs e)
{
foreach (ListViewItem item in lvRoutings.Items)
{
item.Selected = true;
}
}
private void menuAdd_Click(object sender, EventArgs e)
{
var fm = new RoutingRuleSettingDetailsForm();
fm.rulesItem = new RulesItem();
if (fm.ShowDialog() == DialogResult.OK)
{
routingItem.rules.Insert(0, fm.rulesItem);
RefreshRoutingsView();
}
}
private void menuRemove_Click(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
if (UI.ShowYesNo(UIRes.I18N("RemoveRules")) == DialogResult.No)
{
return;
}
for (int k = lvSelecteds.Count - 1; k >= 0; k--)
{
routingItem.rules.RemoveAt(index);
}
RefreshRoutingsView();
}
private void menuExportSelectedRules_Click(object sender, EventArgs e)
{
GetLvSelectedIndex();
var lst = new List<RulesItem>();
foreach (int v in lvSelecteds)
{
lst.Add(routingItem.rules[v]);
}
if (lst.Count > 0)
{
Utils.SetClipboardData(Utils.ToJson(lst));
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
private void lvRoutings_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
{
switch (e.KeyCode)
{
case Keys.A:
menuSelectAll_Click(null, null);
break;
case Keys.C:
menuExportSelectedRules_Click(null, null);
break;
}
}
else
{
switch (e.KeyCode)
{
case Keys.Delete:
menuRemove_Click(null, null);
break;
case Keys.T:
menuMoveTop_Click(null, null);
break;
case Keys.B:
menuMoveBottom_Click(null, null);
break;
case Keys.U:
menuMoveUp_Click(null, null);
break;
case Keys.D:
menuMoveDown_Click(null, null);
break;
}
}
}
#endregion
#region preset rules
private void menuImportRulesFromFile_Click(object sender, EventArgs e)
{
OpenFileDialog fileDialog = new OpenFileDialog
{
Multiselect = false,
Filter = "Rules|*.json|All|*.*"
};
if (fileDialog.ShowDialog() != DialogResult.OK)
{
return;
}
string fileName = fileDialog.FileName;
if (Utils.IsNullOrEmpty(fileName))
{
return;
}
string result = Utils.LoadResource(fileName);
if (Utils.IsNullOrEmpty(result))
{
return;
}
if (ConfigHandler.AddBatchRoutingRules(ref routingItem, result) == 0)
{
RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
private void menuImportRulesFromClipboard_Click(object sender, EventArgs e)
{
string clipboardData = Utils.GetClipboardData();
if (ConfigHandler.AddBatchRoutingRules(ref routingItem, clipboardData) == 0)
{
RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
private void menuImportRulesFromUrl_Click(object sender, EventArgs e)
{
var url = txtUrl.Text.Trim();
if (Utils.IsNullOrEmpty(url))
{
UI.Show(UIRes.I18N("MsgNeedUrl"));
return;
}
DownloadHandle downloadHandle = new DownloadHandle();
string clipboardData = downloadHandle.WebDownloadStringSync(url);
if (ConfigHandler.AddBatchRoutingRules(ref routingItem, clipboardData) == 0)
{
RefreshRoutingsView();
UI.Show(UIRes.I18N("OperationSuccess"));
}
}
#endregion
}
}

View file

@ -0,0 +1,674 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>568, 17</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>475, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 515</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>762, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>18, 63</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Optional</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>91, 45</value>
</data>
<data name="txtUrl.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtUrl.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Vertical</value>
</data>
<data name="txtUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>644, 48</value>
</data>
<data name="txtUrl.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="&gt;&gt;txtUrl.Name" xml:space="preserve">
<value>txtUrl</value>
</data>
<data name="&gt;&gt;txtUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtUrl.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;txtUrl.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>18, 45</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Sub Url</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>91, 13</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>166, 21</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>18, 13</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 25</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>762, 102</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<metadata name="cmsLv.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="menuAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuAdd.Text" xml:space="preserve">
<value>Add</value>
</data>
<data name="menuRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuRemove.Text" xml:space="preserve">
<value>Remove selected</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>Select All (Ctrl+A)</value>
</data>
<data name="menuExportSelectedRules.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuExportSelectedRules.Text" xml:space="preserve">
<value>Export Selected Rules</value>
</data>
<data name="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>199, 6</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuMoveTop.Text" xml:space="preserve">
<value>Move to top (T)</value>
</data>
<data name="menuMoveUp.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuMoveUp.Text" xml:space="preserve">
<value>Up (U)</value>
</data>
<data name="menuMoveDown.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuMoveDown.Text" xml:space="preserve">
<value>Down (D)</value>
</data>
<data name="menuMoveBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>202, 22</value>
</data>
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>Move to bottom (B)</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>Edit and Function</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 186</value>
</data>
<data name="&gt;&gt;cmsLv.Name" xml:space="preserve">
<value>cmsLv</value>
</data>
<data name="&gt;&gt;cmsLv.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="lvRoutings.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="lvRoutings.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0
ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu
PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA
BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5
bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp
bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz
dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA
CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp
bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5
bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3
////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="lvRoutings.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>748, 356</value>
</data>
<data name="lvRoutings.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="&gt;&gt;lvRoutings.Name" xml:space="preserve">
<value>lvRoutings</value>
</data>
<data name="&gt;&gt;lvRoutings.Type" xml:space="preserve">
<value>v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvRoutings.Parent" xml:space="preserve">
<value>tabPage2</value>
</data>
<data name="&gt;&gt;lvRoutings.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tabPage2.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
</data>
<data name="tabPage2.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>754, 362</value>
</data>
<data name="tabPage2.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value>RuleList</value>
</data>
<data name="&gt;&gt;tabPage2.Name" xml:space="preserve">
<value>tabPage2</value>
</data>
<data name="&gt;&gt;tabPage2.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tabPage2.Parent" xml:space="preserve">
<value>tabControl2</value>
</data>
<data name="&gt;&gt;tabPage2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tabControl2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 127</value>
</data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value>762, 388</value>
</data>
<data name="tabControl2.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="&gt;&gt;tabControl2.Name" xml:space="preserve">
<value>tabControl2</value>
</data>
<data name="&gt;&gt;tabControl2.Type" xml:space="preserve">
<value>System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tabControl2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;tabControl2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<metadata name="menuServer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>139, 17</value>
</metadata>
<data name="menuImportRulesFromFile.Size" type="System.Drawing.Size, System.Drawing">
<value>247, 22</value>
</data>
<data name="menuImportRulesFromFile.Text" xml:space="preserve">
<value>Import Rules From File</value>
</data>
<data name="menuImportRulesFromClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>247, 22</value>
</data>
<data name="menuImportRulesFromClipboard.Text" xml:space="preserve">
<value>Import Rules From Clipboard</value>
</data>
<data name="menuImportRulesFromUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>247, 22</value>
</data>
<data name="menuImportRulesFromUrl.Text" xml:space="preserve">
<value>Import Rules From Sub Url</value>
</data>
<data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 21</value>
</data>
<data name="toolStripMenuItem1.Text" xml:space="preserve">
<value>Import Rules</value>
</data>
<data name="menuServer.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>762, 25</value>
</data>
<data name="menuServer.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="&gt;&gt;menuServer.Name" xml:space="preserve">
<value>menuServer</value>
</data>
<data name="&gt;&gt;menuServer.Type" xml:space="preserve">
<value>System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuServer.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;menuServer.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>762, 575</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Rule Settings</value>
</data>
<data name="&gt;&gt;menuAdd.Name" xml:space="preserve">
<value>menuAdd</value>
</data>
<data name="&gt;&gt;menuAdd.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuRemove.Name" xml:space="preserve">
<value>menuRemove</value>
</data>
<data name="&gt;&gt;menuRemove.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuSelectAll.Name" xml:space="preserve">
<value>menuSelectAll</value>
</data>
<data name="&gt;&gt;menuSelectAll.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuExportSelectedRules.Name" xml:space="preserve">
<value>menuExportSelectedRules</value>
</data>
<data name="&gt;&gt;menuExportSelectedRules.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripSeparator3.Name" xml:space="preserve">
<value>toolStripSeparator3</value>
</data>
<data name="&gt;&gt;toolStripSeparator3.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMoveTop.Name" xml:space="preserve">
<value>menuMoveTop</value>
</data>
<data name="&gt;&gt;menuMoveTop.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMoveUp.Name" xml:space="preserve">
<value>menuMoveUp</value>
</data>
<data name="&gt;&gt;menuMoveUp.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMoveDown.Name" xml:space="preserve">
<value>menuMoveDown</value>
</data>
<data name="&gt;&gt;menuMoveDown.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuMoveBottom.Name" xml:space="preserve">
<value>menuMoveBottom</value>
</data>
<data name="&gt;&gt;menuMoveBottom.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;MenuItem1.Name" xml:space="preserve">
<value>MenuItem1</value>
</data>
<data name="&gt;&gt;MenuItem1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripMenuItem1.Name" xml:space="preserve">
<value>toolStripMenuItem1</value>
</data>
<data name="&gt;&gt;toolStripMenuItem1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuImportRulesFromFile.Name" xml:space="preserve">
<value>menuImportRulesFromFile</value>
</data>
<data name="&gt;&gt;menuImportRulesFromFile.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuImportRulesFromClipboard.Name" xml:space="preserve">
<value>menuImportRulesFromClipboard</value>
</data>
<data name="&gt;&gt;menuImportRulesFromClipboard.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuImportRulesFromUrl.Name" xml:space="preserve">
<value>menuImportRulesFromUrl</value>
</data>
<data name="&gt;&gt;menuImportRulesFromUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingRuleSettingForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View file

@ -0,0 +1,285 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 613</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 60</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>可选</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>101, 45</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>订阅地址(Url)</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>101, 13</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>别名</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 109</value>
</data>
<data name="menuAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuAdd.Text" xml:space="preserve">
<value>添加规则</value>
</data>
<data name="menuRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuRemove.Text" xml:space="preserve">
<value>移除所选规则</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>全选</value>
</data>
<data name="menuExportSelectedRules.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuExportSelectedRules.Text" xml:space="preserve">
<value>导出所选规则至剪贴板</value>
</data>
<data name="toolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>193, 6</value>
</data>
<data name="menuMoveTop.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuMoveTop.Text" xml:space="preserve">
<value>上移至顶 (T)</value>
</data>
<data name="menuMoveUp.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuMoveUp.Text" xml:space="preserve">
<value>上移 (U)</value>
</data>
<data name="menuMoveDown.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuMoveDown.Text" xml:space="preserve">
<value>下移 (D)</value>
</data>
<data name="menuMoveBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
</data>
<data name="menuMoveBottom.Text" xml:space="preserve">
<value>下移至底 (B)</value>
</data>
<data name="MenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 21</value>
</data>
<data name="MenuItem1.Text" xml:space="preserve">
<value>规则功能</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>197, 186</value>
</data>
<data name="lvRoutings.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0
ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu
PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA
BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5
bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp
bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz
dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA
CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp
bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5
bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3
////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>771, 447</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>777, 453</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value>规则列表</value>
</data>
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 134</value>
</data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 479</value>
</data>
<data name="menuImportRulesFromFile.Size" type="System.Drawing.Size, System.Drawing">
<value>189, 22</value>
</data>
<data name="menuImportRulesFromFile.Text" xml:space="preserve">
<value>从文件中导入规则</value>
</data>
<data name="menuImportRulesFromClipboard.Size" type="System.Drawing.Size, System.Drawing">
<value>189, 22</value>
</data>
<data name="menuImportRulesFromClipboard.Text" xml:space="preserve">
<value>从剪贴板中导入规则</value>
</data>
<data name="menuImportRulesFromUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>189, 22</value>
</data>
<data name="menuImportRulesFromUrl.Text" xml:space="preserve">
<value>从订阅Url中导入规则</value>
</data>
<data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 21</value>
</data>
<data name="toolStripMenuItem1.Text" xml:space="preserve">
<value>导入规则</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>785, 25</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>785, 673</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>规则集设置</value>
</data>
</root>

View file

@ -0,0 +1,234 @@
namespace v2rayN.Forms
{
partial class RoutingSettingDetailsForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingSettingDetailsForm));
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.clbProtocol = new System.Windows.Forms.CheckedListBox();
this.label3 = new System.Windows.Forms.Label();
this.txtPort = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.labRoutingTips = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.cmbOutboundTag = new System.Windows.Forms.ComboBox();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.panel4 = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtIP = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtDomain = new System.Windows.Forms.TextBox();
this.panel3.SuspendLayout();
this.panel4.SuspendLayout();
this.panel2.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// panel3
//
this.panel3.Controls.Add(this.clbProtocol);
this.panel3.Controls.Add(this.label3);
this.panel3.Controls.Add(this.txtPort);
this.panel3.Controls.Add(this.label1);
this.panel3.Controls.Add(this.labRoutingTips);
this.panel3.Controls.Add(this.label4);
this.panel3.Controls.Add(this.cmbOutboundTag);
this.panel3.Controls.Add(this.txtRemarks);
this.panel3.Controls.Add(this.label2);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3";
//
// clbProtocol
//
this.clbProtocol.CheckOnClick = true;
resources.ApplyResources(this.clbProtocol, "clbProtocol");
this.clbProtocol.FormattingEnabled = true;
this.clbProtocol.Items.AddRange(new object[] {
resources.GetString("clbProtocol.Items"),
resources.GetString("clbProtocol.Items1"),
resources.GetString("clbProtocol.Items2")});
this.clbProtocol.MultiColumn = true;
this.clbProtocol.Name = "clbProtocol";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// txtPort
//
resources.ApplyResources(this.txtPort, "txtPort");
this.txtPort.Name = "txtPort";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// labRoutingTips
//
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.Name = "labRoutingTips";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// cmbOutboundTag
//
this.cmbOutboundTag.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbOutboundTag.FormattingEnabled = true;
this.cmbOutboundTag.Items.AddRange(new object[] {
resources.GetString("cmbOutboundTag.Items"),
resources.GetString("cmbOutboundTag.Items1"),
resources.GetString("cmbOutboundTag.Items2")});
resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag");
this.cmbOutboundTag.Name = "cmbOutboundTag";
//
// txtRemarks
//
resources.ApplyResources(this.txtRemarks, "txtRemarks");
this.txtRemarks.Name = "txtRemarks";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// panel4
//
this.panel4.Controls.Add(this.btnClose);
this.panel4.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Name = "panel4";
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel2
//
this.panel2.Controls.Add(this.groupBox2);
this.panel2.Controls.Add(this.groupBox1);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.txtIP);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// txtIP
//
resources.ApplyResources(this.txtIP, "txtIP");
this.txtIP.Name = "txtIP";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtDomain);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// txtDomain
//
resources.ApplyResources(this.txtDomain, "txtDomain");
this.txtDomain.Name = "txtDomain";
//
// RoutingSettingDetailsForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel4);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel1);
this.Name = "RoutingSettingDetailsForm";
this.Load += new System.EventHandler(this.RoutingSettingDetailsForm_Load);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox cmbOutboundTag;
private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtDomain;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtIP;
private System.Windows.Forms.Label labRoutingTips;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtPort;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckedListBox clbProtocol;
}
}

View file

@ -0,0 +1,131 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingSettingDetailsForm : BaseForm
{
public int EditIndex
{
get; set;
}
protected RulesItem routingItem = null;
public RoutingSettingDetailsForm()
{
InitializeComponent();
}
private void RoutingSettingDetailsForm_Load(object sender, EventArgs e)
{
if (EditIndex >= 0)
{
routingItem = config.rules[EditIndex];
BindingData();
}
else
{
routingItem = new RulesItem();
ClearBind();
}
}
private void EndBindingData()
{
if (routingItem != null)
{
routingItem.remarks = txtRemarks.Text.TrimEx();
routingItem.port = txtPort.Text.TrimEx();
routingItem.outboundTag = cmbOutboundTag.Text;
routingItem.domain = Utils.String2List(txtDomain.Text);
routingItem.ip = Utils.String2List(txtIP.Text);
var protocol = new List<string>();
for (int i = 0; i < clbProtocol.Items.Count; i++)
{
if (clbProtocol.GetItemChecked(i))
{
protocol.Add(clbProtocol.Items[i].ToString());
}
}
routingItem.protocol = protocol;
}
}
private void BindingData()
{
if (routingItem != null)
{
txtRemarks.Text = routingItem.remarks ?? string.Empty;
txtPort.Text = routingItem.port ?? string.Empty;
cmbOutboundTag.Text = routingItem.outboundTag;
txtDomain.Text = Utils.List2String(routingItem.domain, true);
txtIP.Text = Utils.List2String(routingItem.ip, true);
if (routingItem.protocol != null)
{
for (int i = 0; i < clbProtocol.Items.Count; i++)
{
if (routingItem.protocol.Contains(clbProtocol.Items[i].ToString()))
{
clbProtocol.SetItemChecked(i, true);
}
}
}
}
}
private void ClearBind()
{
txtRemarks.Text = string.Empty;
txtPort.Text = string.Empty;
cmbOutboundTag.Text = Global.agentTag;
txtDomain.Text = string.Empty;
txtIP.Text = string.Empty;
}
private void btnOK_Click(object sender, EventArgs e)
{
EndBindingData();
var hasRule = false;
if (routingItem.domain != null && routingItem.domain.Count > 0)
{
hasRule = true;
}
if (routingItem.ip != null && routingItem.ip.Count > 0)
{
hasRule = true;
}
if (routingItem.protocol != null && routingItem.protocol.Count > 0)
{
hasRule = true;
}
if (!Utils.IsNullOrEmpty(routingItem.port))
{
hasRule = true;
}
if (!hasRule)
{
UI.ShowWarning(string.Format(UIRes.I18N("RoutingRuleDetailRequiredTips"), "Port/Protocol/Domain/IP"));
return;
}
if (ConfigHandler.AddRoutingRule(ref config, routingItem, EditIndex) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
this.DialogResult = DialogResult.OK;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -0,0 +1,723 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 10</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="clbProtocol.ColumnWidth" type="System.Int32, mscorlib">
<value>80</value>
</data>
<data name="clbProtocol.Items" xml:space="preserve">
<value>http</value>
</data>
<data name="clbProtocol.Items1" xml:space="preserve">
<value>tls</value>
</data>
<data name="clbProtocol.Items2" xml:space="preserve">
<value>bittorrent</value>
</data>
<data name="clbProtocol.Location" type="System.Drawing.Point, System.Drawing">
<value>347, 43</value>
</data>
<data name="clbProtocol.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 20</value>
</data>
<data name="clbProtocol.TabIndex" type="System.Int32, mscorlib">
<value>39</value>
</data>
<data name="&gt;&gt;clbProtocol.Name" xml:space="preserve">
<value>clbProtocol</value>
</data>
<data name="&gt;&gt;clbProtocol.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;clbProtocol.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;clbProtocol.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>274, 47</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>36</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Protocol</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtPort.Location" type="System.Drawing.Point, System.Drawing">
<value>84, 43</value>
</data>
<data name="txtPort.Size" type="System.Drawing.Size, System.Drawing">
<value>166, 21</value>
</data>
<data name="txtPort.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<data name="&gt;&gt;txtPort.Name" xml:space="preserve">
<value>txtPort</value>
</data>
<data name="&gt;&gt;txtPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtPort.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;txtPort.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 47</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Port</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="labRoutingTips.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 82</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>598, 16</value>
</data>
<data name="labRoutingTips.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*Set the rules, separated by commas (,); The comma in the regular is replaced by &lt;COMMA&gt;</value>
</data>
<data name="&gt;&gt;labRoutingTips.Name" xml:space="preserve">
<value>labRoutingTips</value>
</data>
<data name="&gt;&gt;labRoutingTips.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labRoutingTips.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;labRoutingTips.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>274, 20</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>Out Tag</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="cmbOutboundTag.Items" xml:space="preserve">
<value>proxy</value>
</data>
<data name="cmbOutboundTag.Items1" xml:space="preserve">
<value>direct</value>
</data>
<data name="cmbOutboundTag.Items2" xml:space="preserve">
<value>block</value>
</data>
<data name="cmbOutboundTag.Location" type="System.Drawing.Point, System.Drawing">
<value>347, 16</value>
</data>
<data name="cmbOutboundTag.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 20</value>
</data>
<data name="cmbOutboundTag.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Name" xml:space="preserve">
<value>cmbOutboundTag</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;cmbOutboundTag.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>84, 16</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>166, 21</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 20</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 12</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>29</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="panel3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="panel3.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 10</value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 111</value>
</data>
<data name="panel3.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;panel3.Name" xml:space="preserve">
<value>panel3</value>
</data>
<data name="&gt;&gt;panel3.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel3.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel4.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 516</value>
</data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 60</value>
</data>
<data name="panel4.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;panel4.Name" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;panel4.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel4.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel4.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>504, 15</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>411, 15</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel4</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;groupBox2.Name" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;groupBox2.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox2.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 121</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>742, 395</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;txtIP.Name" xml:space="preserve">
<value>txtIP</value>
</data>
<data name="&gt;&gt;txtIP.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtIP.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>392, 0</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>350, 395</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>IP</value>
</data>
<data name="&gt;&gt;groupBox2.Name" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;groupBox2.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox2.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtIP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtIP.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtIP.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtIP.Size" type="System.Drawing.Size, System.Drawing">
<value>344, 375</value>
</data>
<data name="txtIP.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;txtIP.Name" xml:space="preserve">
<value>txtIP</value>
</data>
<data name="&gt;&gt;txtIP.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtIP.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;txtIP.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;txtDomain.Name" xml:space="preserve">
<value>txtDomain</value>
</data>
<data name="&gt;&gt;txtDomain.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtDomain.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Left</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 395</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Domain</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtDomain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="txtDomain.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 17</value>
</data>
<data name="txtDomain.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 375</value>
</data>
<data name="txtDomain.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="&gt;&gt;txtDomain.Name" xml:space="preserve">
<value>txtDomain</value>
</data>
<data name="&gt;&gt;txtDomain.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtDomain.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;txtDomain.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>742, 576</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>RoutingSettingDetailsForm</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingSettingDetailsForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View file

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的路由规则,用逗号(,)分隔;正则中的逗号用&lt;COMMA&gt;替代</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 12</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>OutboundTag</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>别名</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>路由规则详情设置</value>
</data>
</root>

View file

@ -0,0 +1,447 @@
namespace v2rayN.Forms
{
partial class RoutingSettingForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingSettingForm));
this.btnClose = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.labRoutingTips = new System.Windows.Forms.Label();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.chkenableRoutingAdvanced = new System.Windows.Forms.CheckBox();
this.linkLabelRoutingDoc = new System.Windows.Forms.LinkLabel();
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
this.cmsLv = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuAdd = new System.Windows.Forms.ToolStripMenuItem();
this.menuRemove = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.menuSetDefaultRouting = new System.Windows.Forms.ToolStripMenuItem();
this.MenuItemAdvanced = new System.Windows.Forms.ToolStripMenuItem();
this.menuServer = new System.Windows.Forms.MenuStrip();
this.MenuItemBasic = new System.Windows.Forms.ToolStripMenuItem();
this.menuImportBasicRules = new System.Windows.Forms.ToolStripMenuItem();
this.tabNormal = new System.Windows.Forms.TabControl();
this.tabPageProxy = new System.Windows.Forms.TabPage();
this.panel5 = new System.Windows.Forms.Panel();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.txtProxyIp = new System.Windows.Forms.TextBox();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.txtProxyDomain = new System.Windows.Forms.TextBox();
this.tabPageDirect = new System.Windows.Forms.TabPage();
this.panel4 = new System.Windows.Forms.Panel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.txtDirectIp = new System.Windows.Forms.TextBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.txtDirectDomain = new System.Windows.Forms.TextBox();
this.tabPageBlock = new System.Windows.Forms.TabPage();
this.panel3 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtBlockIp = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtBlockDomain = new System.Windows.Forms.TextBox();
this.tabPageRuleList = new System.Windows.Forms.TabPage();
this.lvRoutings = new v2rayN.Base.ListViewFlickerFree();
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
this.cmsLv.SuspendLayout();
this.menuServer.SuspendLayout();
this.tabNormal.SuspendLayout();
this.tabPageProxy.SuspendLayout();
this.panel5.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox6.SuspendLayout();
this.tabPageDirect.SuspendLayout();
this.panel4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.tabPageBlock.SuspendLayout();
this.panel3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPageRuleList.SuspendLayout();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// panel2
//
this.panel2.Controls.Add(this.labRoutingTips);
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// labRoutingTips
//
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
this.labRoutingTips.Name = "labRoutingTips";
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panel1
//
this.panel1.Controls.Add(this.chkenableRoutingAdvanced);
this.panel1.Controls.Add(this.linkLabelRoutingDoc);
this.panel1.Controls.Add(this.cmbdomainStrategy);
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// chkenableRoutingAdvanced
//
resources.ApplyResources(this.chkenableRoutingAdvanced, "chkenableRoutingAdvanced");
this.chkenableRoutingAdvanced.Name = "chkenableRoutingAdvanced";
this.chkenableRoutingAdvanced.UseVisualStyleBackColor = true;
this.chkenableRoutingAdvanced.CheckedChanged += new System.EventHandler(this.chkenableRoutingAdvanced_CheckedChanged_1);
//
// linkLabelRoutingDoc
//
resources.ApplyResources(this.linkLabelRoutingDoc, "linkLabelRoutingDoc");
this.linkLabelRoutingDoc.Name = "linkLabelRoutingDoc";
this.linkLabelRoutingDoc.TabStop = true;
this.linkLabelRoutingDoc.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelRoutingDoc_LinkClicked);
//
// cmbdomainStrategy
//
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbdomainStrategy.FormattingEnabled = true;
this.cmbdomainStrategy.Items.AddRange(new object[] {
resources.GetString("cmbdomainStrategy.Items"),
resources.GetString("cmbdomainStrategy.Items1"),
resources.GetString("cmbdomainStrategy.Items2")});
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
//
// cmsLv
//
this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuAdd,
this.menuRemove,
this.menuSelectAll,
this.menuSetDefaultRouting});
this.cmsLv.Name = "cmsLv";
this.cmsLv.OwnerItem = this.MenuItemAdvanced;
resources.ApplyResources(this.cmsLv, "cmsLv");
//
// menuAdd
//
this.menuAdd.Name = "menuAdd";
resources.ApplyResources(this.menuAdd, "menuAdd");
this.menuAdd.Click += new System.EventHandler(this.menuAdd_Click);
//
// menuRemove
//
this.menuRemove.Name = "menuRemove";
resources.ApplyResources(this.menuRemove, "menuRemove");
this.menuRemove.Click += new System.EventHandler(this.menuRemove_Click);
//
// menuSelectAll
//
this.menuSelectAll.Name = "menuSelectAll";
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
//
// menuSetDefaultRouting
//
this.menuSetDefaultRouting.Name = "menuSetDefaultRouting";
resources.ApplyResources(this.menuSetDefaultRouting, "menuSetDefaultRouting");
this.menuSetDefaultRouting.Click += new System.EventHandler(this.menuSetDefaultRouting_Click);
//
// MenuItemAdvanced
//
this.MenuItemAdvanced.DropDown = this.cmsLv;
this.MenuItemAdvanced.Name = "MenuItemAdvanced";
resources.ApplyResources(this.MenuItemAdvanced, "MenuItemAdvanced");
//
// menuServer
//
this.menuServer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MenuItemBasic,
this.MenuItemAdvanced});
resources.ApplyResources(this.menuServer, "menuServer");
this.menuServer.Name = "menuServer";
//
// MenuItemBasic
//
this.MenuItemBasic.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuImportBasicRules});
this.MenuItemBasic.Name = "MenuItemBasic";
resources.ApplyResources(this.MenuItemBasic, "MenuItemBasic");
//
// menuImportBasicRules
//
this.menuImportBasicRules.Name = "menuImportBasicRules";
resources.ApplyResources(this.menuImportBasicRules, "menuImportBasicRules");
this.menuImportBasicRules.Click += new System.EventHandler(this.menuImportBasicRules_Click);
//
// tabNormal
//
this.tabNormal.Controls.Add(this.tabPageProxy);
this.tabNormal.Controls.Add(this.tabPageDirect);
this.tabNormal.Controls.Add(this.tabPageBlock);
this.tabNormal.Controls.Add(this.tabPageRuleList);
resources.ApplyResources(this.tabNormal, "tabNormal");
this.tabNormal.Name = "tabNormal";
this.tabNormal.SelectedIndex = 0;
this.tabNormal.Selecting += new System.Windows.Forms.TabControlCancelEventHandler(this.tabNormal_Selecting);
//
// tabPageProxy
//
this.tabPageProxy.Controls.Add(this.panel5);
resources.ApplyResources(this.tabPageProxy, "tabPageProxy");
this.tabPageProxy.Name = "tabPageProxy";
this.tabPageProxy.UseVisualStyleBackColor = true;
//
// panel5
//
this.panel5.Controls.Add(this.groupBox5);
this.panel5.Controls.Add(this.groupBox6);
resources.ApplyResources(this.panel5, "panel5");
this.panel5.Name = "panel5";
//
// groupBox5
//
this.groupBox5.Controls.Add(this.txtProxyIp);
resources.ApplyResources(this.groupBox5, "groupBox5");
this.groupBox5.Name = "groupBox5";
this.groupBox5.TabStop = false;
//
// txtProxyIp
//
resources.ApplyResources(this.txtProxyIp, "txtProxyIp");
this.txtProxyIp.Name = "txtProxyIp";
//
// groupBox6
//
this.groupBox6.Controls.Add(this.txtProxyDomain);
resources.ApplyResources(this.groupBox6, "groupBox6");
this.groupBox6.Name = "groupBox6";
this.groupBox6.TabStop = false;
//
// txtProxyDomain
//
resources.ApplyResources(this.txtProxyDomain, "txtProxyDomain");
this.txtProxyDomain.Name = "txtProxyDomain";
//
// tabPageDirect
//
this.tabPageDirect.Controls.Add(this.panel4);
resources.ApplyResources(this.tabPageDirect, "tabPageDirect");
this.tabPageDirect.Name = "tabPageDirect";
this.tabPageDirect.UseVisualStyleBackColor = true;
//
// panel4
//
this.panel4.Controls.Add(this.groupBox3);
this.panel4.Controls.Add(this.groupBox4);
resources.ApplyResources(this.panel4, "panel4");
this.panel4.Name = "panel4";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.txtDirectIp);
resources.ApplyResources(this.groupBox3, "groupBox3");
this.groupBox3.Name = "groupBox3";
this.groupBox3.TabStop = false;
//
// txtDirectIp
//
resources.ApplyResources(this.txtDirectIp, "txtDirectIp");
this.txtDirectIp.Name = "txtDirectIp";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.txtDirectDomain);
resources.ApplyResources(this.groupBox4, "groupBox4");
this.groupBox4.Name = "groupBox4";
this.groupBox4.TabStop = false;
//
// txtDirectDomain
//
resources.ApplyResources(this.txtDirectDomain, "txtDirectDomain");
this.txtDirectDomain.Name = "txtDirectDomain";
//
// tabPageBlock
//
this.tabPageBlock.Controls.Add(this.panel3);
resources.ApplyResources(this.tabPageBlock, "tabPageBlock");
this.tabPageBlock.Name = "tabPageBlock";
this.tabPageBlock.UseVisualStyleBackColor = true;
//
// panel3
//
this.panel3.Controls.Add(this.groupBox2);
this.panel3.Controls.Add(this.groupBox1);
resources.ApplyResources(this.panel3, "panel3");
this.panel3.Name = "panel3";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.txtBlockIp);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// txtBlockIp
//
resources.ApplyResources(this.txtBlockIp, "txtBlockIp");
this.txtBlockIp.Name = "txtBlockIp";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtBlockDomain);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// txtBlockDomain
//
resources.ApplyResources(this.txtBlockDomain, "txtBlockDomain");
this.txtBlockDomain.Name = "txtBlockDomain";
//
// tabPageRuleList
//
this.tabPageRuleList.Controls.Add(this.lvRoutings);
resources.ApplyResources(this.tabPageRuleList, "tabPageRuleList");
this.tabPageRuleList.Name = "tabPageRuleList";
this.tabPageRuleList.UseVisualStyleBackColor = true;
//
// lvRoutings
//
this.lvRoutings.ContextMenuStrip = this.cmsLv;
resources.ApplyResources(this.lvRoutings, "lvRoutings");
this.lvRoutings.FullRowSelect = true;
this.lvRoutings.GridLines = true;
this.lvRoutings.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.lvRoutings.HideSelection = false;
this.lvRoutings.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
((System.Windows.Forms.ListViewItem)(resources.GetObject("lvRoutings.Items")))});
this.lvRoutings.MultiSelect = false;
this.lvRoutings.Name = "lvRoutings";
this.lvRoutings.UseCompatibleStateImageBehavior = false;
this.lvRoutings.View = System.Windows.Forms.View.Details;
this.lvRoutings.DoubleClick += new System.EventHandler(this.lvRoutings_DoubleClick);
//
// RoutingSettingForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.tabNormal);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel2);
this.Controls.Add(this.menuServer);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "RoutingSettingForm";
this.Load += new System.EventHandler(this.RoutingSettingForm_Load);
this.panel2.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.cmsLv.ResumeLayout(false);
this.menuServer.ResumeLayout(false);
this.menuServer.PerformLayout();
this.tabNormal.ResumeLayout(false);
this.tabPageProxy.ResumeLayout(false);
this.panel5.ResumeLayout(false);
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.tabPageDirect.ResumeLayout(false);
this.panel4.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.tabPageBlock.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tabPageRuleList.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.LinkLabel linkLabelRoutingDoc;
private System.Windows.Forms.ComboBox cmbdomainStrategy;
private System.Windows.Forms.ContextMenuStrip cmsLv;
private System.Windows.Forms.ToolStripMenuItem menuRemove;
private System.Windows.Forms.ToolStripMenuItem menuSelectAll;
private System.Windows.Forms.ToolStripMenuItem menuAdd;
private System.Windows.Forms.MenuStrip menuServer;
private System.Windows.Forms.ToolStripMenuItem MenuItemAdvanced;
private System.Windows.Forms.ToolStripMenuItem menuSetDefaultRouting;
private System.Windows.Forms.TabControl tabNormal;
private System.Windows.Forms.TabPage tabPageProxy;
private System.Windows.Forms.TabPage tabPageDirect;
private System.Windows.Forms.TabPage tabPageBlock;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.TextBox txtProxyIp;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.TextBox txtProxyDomain;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox txtDirectIp;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TextBox txtDirectDomain;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txtBlockIp;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtBlockDomain;
private System.Windows.Forms.TabPage tabPageRuleList;
private Base.ListViewFlickerFree lvRoutings;
private System.Windows.Forms.Label labRoutingTips;
private System.Windows.Forms.CheckBox chkenableRoutingAdvanced;
private System.Windows.Forms.ToolStripMenuItem MenuItemBasic;
private System.Windows.Forms.ToolStripMenuItem menuImportBasicRules;
}
}

View file

@ -0,0 +1,302 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingSettingForm : BaseForm
{
private List<int> lvSelecteds = new List<int>();
private RoutingItem lockedItem;
public RoutingSettingForm()
{
InitializeComponent();
}
private void RoutingSettingForm_Load(object sender, EventArgs e)
{
ConfigHandler.InitBuiltinRouting(ref config);
cmbdomainStrategy.Text = config.domainStrategy;
chkenableRoutingAdvanced.Checked = config.enableRoutingAdvanced;
if (config.routings == null)
{
config.routings = new List<RoutingItem>();
}
InitRoutingsView();
RefreshRoutingsView();
BindingLockedData();
InitUI();
}
private void tabNormal_Selecting(object sender, TabControlCancelEventArgs e)
{
//if (tabNormal.SelectedTab == tabPageRuleList)
//{
// MenuItem1.Enabled = true;
//}
//else
//{
// MenuItem1.Enabled = false;
//}
}
private void btnOK_Click(object sender, EventArgs e)
{
config.domainStrategy = cmbdomainStrategy.Text;
config.enableRoutingAdvanced = chkenableRoutingAdvanced.Checked;
EndBindingLockedData();
if (ConfigHandler.SaveRouting(ref config) == 0)
{
this.DialogResult = DialogResult.OK;
}
else
{
UI.ShowWarning(UIRes.I18N("OperationFailed"));
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
private void chkenableRoutingAdvanced_CheckedChanged_1(object sender, EventArgs e)
{
InitUI();
}
private void InitUI()
{
if (chkenableRoutingAdvanced.Checked)
{
this.tabPageProxy.Parent = null;
this.tabPageDirect.Parent = null;
this.tabPageBlock.Parent = null;
this.tabPageRuleList.Parent = tabNormal;
MenuItemBasic.Enabled = false;
MenuItemAdvanced.Enabled = true;
}
else
{
this.tabPageProxy.Parent = tabNormal;
this.tabPageDirect.Parent = tabNormal;
this.tabPageBlock.Parent = tabNormal;
this.tabPageRuleList.Parent = null;
MenuItemBasic.Enabled = true;
MenuItemAdvanced.Enabled = false;
}
}
#region locked
private void BindingLockedData()
{
lockedItem = ConfigHandler.GetLockedRoutingItem(ref config);
if (lockedItem != null)
{
txtProxyDomain.Text = Utils.List2String(lockedItem.rules[0].domain, true);
txtProxyIp.Text = Utils.List2String(lockedItem.rules[0].ip, true);
txtDirectDomain.Text = Utils.List2String(lockedItem.rules[1].domain, true);
txtDirectIp.Text = Utils.List2String(lockedItem.rules[1].ip, true);
txtBlockDomain.Text = Utils.List2String(lockedItem.rules[2].domain, true);
txtBlockIp.Text = Utils.List2String(lockedItem.rules[2].ip, true);
}
}
private void EndBindingLockedData()
{
if (lockedItem != null)
{
lockedItem.rules[0].domain = Utils.String2List(txtProxyDomain.Text.TrimEx());
lockedItem.rules[0].ip = Utils.String2List(txtProxyIp.Text.TrimEx());
lockedItem.rules[1].domain = Utils.String2List(txtDirectDomain.Text.TrimEx());
lockedItem.rules[1].ip = Utils.String2List(txtDirectIp.Text.TrimEx());
lockedItem.rules[2].domain = Utils.String2List(txtBlockDomain.Text.TrimEx());
lockedItem.rules[2].ip = Utils.String2List(txtBlockIp.Text.TrimEx());
}
}
#endregion
#region ListView
private void InitRoutingsView()
{
lvRoutings.BeginUpdate();
lvRoutings.Items.Clear();
lvRoutings.GridLines = true;
lvRoutings.FullRowSelect = true;
lvRoutings.View = View.Details;
lvRoutings.MultiSelect = true;
lvRoutings.HeaderStyle = ColumnHeaderStyle.Clickable;
lvRoutings.Columns.Add("", 30);
lvRoutings.Columns.Add(UIRes.I18N("LvAlias"), 200);
lvRoutings.Columns.Add(UIRes.I18N("LvCount"), 60);
lvRoutings.Columns.Add(UIRes.I18N("LvUrl"), 240);
lvRoutings.EndUpdate();
}
private void RefreshRoutingsView()
{
lvRoutings.BeginUpdate();
lvRoutings.Items.Clear();
for (int k = 0; k < config.routings.Count; k++)
{
var item = config.routings[k];
if (item.locked == true)
{
continue;
}
string def = string.Empty;
if (config.routingIndex.Equals(k))
{
def = "√";
}
ListViewItem lvItem = new ListViewItem(def);
Utils.AddSubItem(lvItem, "remarks", item.remarks);
Utils.AddSubItem(lvItem, "count", item.rules.Count.ToString());
Utils.AddSubItem(lvItem, "url", item.url);
if (lvItem != null) lvRoutings.Items.Add(lvItem);
}
lvRoutings.EndUpdate();
}
private void linkLabelRoutingDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://www.v2fly.org/config/routing.html");
}
private void lvRoutings_DoubleClick(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
var fm = new RoutingRuleSettingForm();
fm.EditIndex = index;
if (fm.ShowDialog() == DialogResult.OK)
{
RefreshRoutingsView();
}
}
private int GetLvSelectedIndex()
{
int index = -1;
lvSelecteds.Clear();
try
{
if (lvRoutings.SelectedIndices.Count <= 0)
{
UI.Show(UIRes.I18N("PleaseSelectRules"));
return index;
}
index = lvRoutings.SelectedIndices[0];
foreach (int i in lvRoutings.SelectedIndices)
{
lvSelecteds.Add(i);
}
return index;
}
catch
{
return index;
}
}
#endregion
#region Edit function
private void menuSelectAll_Click(object sender, EventArgs e)
{
foreach (ListViewItem item in lvRoutings.Items)
{
item.Selected = true;
}
}
private void menuAdd_Click(object sender, EventArgs e)
{
var fm = new RoutingRuleSettingForm();
fm.EditIndex = -1;
if (fm.ShowDialog() == DialogResult.OK)
{
RefreshRoutingsView();
}
}
private void menuRemove_Click(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
if (UI.ShowYesNo(UIRes.I18N("RemoveRules")) == DialogResult.No)
{
return;
}
for (int k = lvSelecteds.Count - 1; k >= 0; k--)
{
config.routings.RemoveAt(index);
}
RefreshRoutingsView();
}
private void menuSetDefaultRouting_Click(object sender, EventArgs e)
{
int index = GetLvSelectedIndex();
if (index < 0)
{
return;
}
SetDefaultRouting(index);
}
private int SetDefaultRouting(int index)
{
if (index < 0)
{
UI.Show(UIRes.I18N("PleaseSelectServer"));
return -1;
}
if (ConfigHandler.SetDefaultRouting(ref config, index) == 0)
{
RefreshRoutingsView();
}
return 0;
}
private void menuImportBasicRules_Click(object sender, EventArgs e)
{
//Extra to bypass the mainland
txtDirectDomain.Text = "geosite:cn";
txtDirectIp.Text = "geoip:private,geoip:cn";
txtBlockDomain.Text = "geosite:category-ads-all";
}
#endregion
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,306 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>691, 17</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 545</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 60</value>
</data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>518, 16</value>
</data>
<data name="labRoutingTips.Text" xml:space="preserve">
<value>*设置的路由规则,用逗号(,)分隔;正则中的逗号用&lt;COMMA&gt;替代</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>598, 17</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 51</value>
</data>
<data name="chkenableRoutingAdvanced.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 16</value>
</data>
<data name="chkenableRoutingAdvanced.Text" xml:space="preserve">
<value>启用路由高级功能</value>
</data>
<data name="linkLabelRoutingDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
</data>
<data name="linkLabelRoutingDoc.Text" xml:space="preserve">
<value>域名解析策略</value>
</data>
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
<value>149, 92</value>
</data>
<data name="menuAdd.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="menuAdd.Text" xml:space="preserve">
<value>添加规则集</value>
</data>
<data name="menuRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="menuRemove.Text" xml:space="preserve">
<value>移除所选规则</value>
</data>
<data name="menuSelectAll.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="menuSelectAll.Text" xml:space="preserve">
<value>全选</value>
</data>
<data name="menuSetDefaultRouting.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="menuSetDefaultRouting.Text" xml:space="preserve">
<value>设为活动路由</value>
</data>
<data name="MenuItemAdvanced.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 21</value>
</data>
<data name="MenuItemAdvanced.Text" xml:space="preserve">
<value>高级功能</value>
</data>
<data name="menuServer.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 25</value>
</data>
<data name="MenuItemBasic.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 21</value>
</data>
<data name="MenuItemBasic.Text" xml:space="preserve">
<value>基础功能</value>
</data>
<data name="menuImportBasicRules.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
</data>
<data name="menuImportBasicRules.Text" xml:space="preserve">
<value>一键导入基础规则</value>
</data>
<data name="tabNormal.Size" type="System.Drawing.Size, System.Drawing">
<value>817, 469</value>
</data>
<data name="tabPageProxy.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
</data>
<data name="tabPageProxy.Text" xml:space="preserve">
<value> 1.代理的Domain或IP </value>
</data>
<data name="panel5.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="groupBox5.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 437</value>
</data>
<data name="txtProxyIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
</data>
<data name="groupBox6.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="txtProxyDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="tabPageDirect.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
</data>
<data name="tabPageDirect.Text" xml:space="preserve">
<value> 2.直连的Domain或IP </value>
</data>
<data name="panel4.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="groupBox3.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 437</value>
</data>
<data name="txtDirectIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
</data>
<data name="groupBox4.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="txtDirectDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="tabPageBlock.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
</data>
<data name="tabPageBlock.Text" xml:space="preserve">
<value> 3.阻止的Domain或IP </value>
</data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>411, 437</value>
</data>
<data name="txtBlockIp.Size" type="System.Drawing.Size, System.Drawing">
<value>405, 417</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>392, 437</value>
</data>
<data name="txtBlockDomain.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 417</value>
</data>
<data name="tabPageRuleList.Size" type="System.Drawing.Size, System.Drawing">
<value>809, 443</value>
</data>
<data name="tabPageRuleList.Text" xml:space="preserve">
<value> 预定义规则集列表</value>
</data>
<data name="lvRoutings.Items" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0
ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu
PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA
BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5
bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp
bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz
dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA
CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp
bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5
bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3
////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
</value>
</data>
<data name="lvRoutings.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 437</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>817, 605</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>路由设置</value>
</data>
</root>

View file

@ -0,0 +1,106 @@
namespace v2rayN.Forms
{
partial class RoutingSubSettingForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoutingSubSettingForm));
this.panel2 = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.panCon = new System.Windows.Forms.Panel();
this.txtUrl = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.panel2.SuspendLayout();
this.panCon.SuspendLayout();
this.SuspendLayout();
//
// panel2
//
this.panel2.Controls.Add(this.btnClose);
this.panel2.Controls.Add(this.btnOK);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.btnClose, "btnClose");
this.btnClose.Name = "btnClose";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnOK
//
resources.ApplyResources(this.btnOK, "btnOK");
this.btnOK.Name = "btnOK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// panCon
//
resources.ApplyResources(this.panCon, "panCon");
this.panCon.Controls.Add(this.txtUrl);
this.panCon.Controls.Add(this.label3);
this.panCon.Name = "panCon";
//
// txtUrl
//
resources.ApplyResources(this.txtUrl, "txtUrl");
this.txtUrl.Name = "txtUrl";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// RoutingSubSettingForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.Controls.Add(this.panCon);
this.Controls.Add(this.panel2);
this.Name = "RoutingSubSettingForm";
this.Load += new System.EventHandler(this.RoutingSubSettingForm_Load);
this.panel2.ResumeLayout(false);
this.panCon.ResumeLayout(false);
this.panCon.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Panel panCon;
private System.Windows.Forms.TextBox txtUrl;
private System.Windows.Forms.Label label3;
}
}

View file

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
{
public partial class RoutingSubSettingForm : BaseForm
{
public string Url;
public RoutingSubSettingForm()
{
InitializeComponent();
}
private void RoutingSubSettingForm_Load(object sender, EventArgs e)
{
if (config.ruleSubItem == null)
{
config.ruleSubItem = new List<SubItem>();
}
if (config.ruleSubItem.Count <= 0)
{
config.ruleSubItem.Add(new SubItem
{
remarks = "def",
url = Global.CustomRoutingListUrl + "custom_routing_rules"
});
}
txtUrl.Text = config.ruleSubItem[0].url;
}
private void btnOK_Click(object sender, EventArgs e)
{
var url = txtUrl.Text.Trim();
if (Utils.IsNullOrEmpty(url))
{
return;
}
Url = url;
config.ruleSubItem[0].url = url;
ConfigHandler.SaveRuleSubItem(ref config);
this.DialogResult = DialogResult.OK;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -0,0 +1,300 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>448, 17</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>355, 17</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 166</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>545, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panCon.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>83, 19</value>
</data>
<data name="txtUrl.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>450, 113</value>
</data>
<data name="txtUrl.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;txtUrl.Name" xml:space="preserve">
<value>txtUrl</value>
</data>
<data name="&gt;&gt;txtUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtUrl.Parent" xml:space="preserve">
<value>panCon</value>
</data>
<data name="&gt;&gt;txtUrl.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 19</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 12</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Url</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>panCon</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panCon.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="panCon.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="panCon.Size" type="System.Drawing.Size, System.Drawing">
<value>545, 166</value>
</data>
<data name="panCon.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;panCon.Name" xml:space="preserve">
<value>panCon</value>
</data>
<data name="&gt;&gt;panCon.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panCon.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panCon.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>545, 226</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>RoutingSubSetting</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>RoutingSubSettingForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View file

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value>
</data>
<data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>地址 (url)</value>
</data>
</root>

View file

@ -29,27 +29,38 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SubSettingControl));
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.grbMain = new System.Windows.Forms.GroupBox();
this.btnShare = new System.Windows.Forms.Button();
this.chkEnabled = new System.Windows.Forms.CheckBox();
this.btnRemove = new System.Windows.Forms.Button();
this.txtUrl = new System.Windows.Forms.TextBox();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.groupBox2.SuspendLayout();
this.picQRCode = new System.Windows.Forms.PictureBox();
this.grbMain.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picQRCode)).BeginInit();
this.SuspendLayout();
//
// groupBox2
// grbMain
//
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.chkEnabled);
this.groupBox2.Controls.Add(this.btnRemove);
this.groupBox2.Controls.Add(this.txtUrl);
this.groupBox2.Controls.Add(this.txtRemarks);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
this.grbMain.Controls.Add(this.btnShare);
this.grbMain.Controls.Add(this.chkEnabled);
this.grbMain.Controls.Add(this.btnRemove);
this.grbMain.Controls.Add(this.txtUrl);
this.grbMain.Controls.Add(this.txtRemarks);
this.grbMain.Controls.Add(this.label2);
this.grbMain.Controls.Add(this.label3);
resources.ApplyResources(this.grbMain, "grbMain");
this.grbMain.Name = "grbMain";
this.grbMain.TabStop = false;
//
// btnShare
//
resources.ApplyResources(this.btnShare, "btnShare");
this.btnShare.Name = "btnShare";
this.btnShare.UseVisualStyleBackColor = true;
this.btnShare.Click += new System.EventHandler(this.btnShare_Click);
//
// chkEnabled
//
@ -87,27 +98,37 @@
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// picQRCode
//
resources.ApplyResources(this.picQRCode, "picQRCode");
this.picQRCode.Name = "picQRCode";
this.picQRCode.TabStop = false;
//
// SubSettingControl
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.picQRCode);
this.Controls.Add(this.grbMain);
this.Name = "SubSettingControl";
this.Load += new System.EventHandler(this.SubSettingControl_Load);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.grbMain.ResumeLayout(false);
this.grbMain.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picQRCode)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox grbMain;
private System.Windows.Forms.TextBox txtUrl;
private System.Windows.Forms.TextBox txtRemarks;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button btnRemove;
private System.Windows.Forms.CheckBox chkEnabled;
private System.Windows.Forms.Button btnShare;
private System.Windows.Forms.PictureBox picQRCode;
}
}

View file

@ -1,6 +1,7 @@
using System;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Handler;
using v2rayN.Mode;
namespace v2rayN.Forms
@ -11,7 +12,10 @@ namespace v2rayN.Forms
public event ChangeEventHandler OnButtonClicked;
public SubItem subItem { get; set; }
public SubItem subItem
{
get; set;
}
public SubSettingControl()
{
@ -20,6 +24,7 @@ namespace v2rayN.Forms
private void SubSettingControl_Load(object sender, EventArgs e)
{
this.Height = grbMain.Height;
BindingSub();
}
@ -56,5 +61,23 @@ namespace v2rayN.Forms
OnButtonClicked?.Invoke(sender, e);
}
private void btnShare_Click(object sender, EventArgs e)
{
if (this.Height <= grbMain.Height)
{
if (Utils.IsNullOrEmpty(subItem.url))
{
picQRCode.Image = null;
return;
}
picQRCode.Image = QRCodeHelper.GetQRCode(subItem.url);
this.Height = grbMain.Height + 200;
}
else
{
this.Height = grbMain.Height;
}
}
}
}

View file

@ -118,34 +118,34 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib">
<value>zh-Hans</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>584, 119</value>
</data>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<data name="btnShare.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing">
<value>484, 21</value>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnShare.Location" type="System.Drawing.Point, System.Drawing">
<value>434, 21</value>
</data>
<data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
<data name="btnShare.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnRemove.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnShare.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
</data>
<data name="btnRemove.Text" xml:space="preserve">
<value>&amp;Remove</value>
<data name="btnShare.Text" xml:space="preserve">
<value>Share</value>
</data>
<data name="&gt;&gt;btnShare.Name" xml:space="preserve">
<value>btnShare</value>
</data>
<data name="&gt;&gt;btnShare.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnShare.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;btnShare.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="chkEnabled.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -154,7 +154,7 @@
<value>NoControl</value>
</data>
<data name="chkEnabled.Location" type="System.Drawing.Point, System.Drawing">
<value>406, 23</value>
<value>368, 23</value>
</data>
<data name="chkEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>60, 16</value>
@ -165,20 +165,92 @@
<data name="chkEnabled.Text" xml:space="preserve">
<value>Enable</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
<data name="&gt;&gt;chkEnabled.Name" xml:space="preserve">
<value>chkEnabled</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 9</value>
<data name="&gt;&gt;chkEnabled.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>584, 110</value>
<data name="&gt;&gt;chkEnabled.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
<data name="&gt;&gt;chkEnabled.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>Subscription details</value>
<data name="btnRemove.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnRemove.Location" type="System.Drawing.Point, System.Drawing">
<value>525, 21</value>
</data>
<data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnRemove.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="btnRemove.Text" xml:space="preserve">
<value>Remove</value>
</data>
<data name="&gt;&gt;btnRemove.Name" xml:space="preserve">
<value>btnRemove</value>
</data>
<data name="&gt;&gt;btnRemove.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnRemove.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;btnRemove.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 55</value>
</data>
<data name="txtUrl.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="txtUrl.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Vertical</value>
</data>
<data name="txtUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>473, 46</value>
</data>
<data name="txtUrl.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="&gt;&gt;txtUrl.Name" xml:space="preserve">
<value>txtUrl</value>
</data>
<data name="&gt;&gt;txtUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtUrl.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;txtUrl.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 21</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 21</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;txtRemarks.Name" xml:space="preserve">
<value>txtRemarks</value>
</data>
<data name="&gt;&gt;txtRemarks.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtRemarks.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;txtRemarks.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -198,6 +270,18 @@
<data name="label2.Text" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@ -216,25 +300,88 @@
<data name="label3.Text" xml:space="preserve">
<value>Address (url)</value>
</data>
<data name="txtRemarks.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 21</value>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="txtRemarks.Size" type="System.Drawing.Size, System.Drawing">
<value>265, 21</value>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="txtRemarks.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="txtUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>127, 55</value>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="txtUrl.Multiline" type="System.Boolean, mscorlib">
<data name="grbMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="grbMain.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="grbMain.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 110</value>
</data>
<data name="grbMain.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="grbMain.Text" xml:space="preserve">
<value>Subscription details</value>
</data>
<data name="&gt;&gt;grbMain.Name" xml:space="preserve">
<value>grbMain</value>
</data>
<data name="&gt;&gt;grbMain.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;grbMain.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;grbMain.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="picQRCode.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="picQRCode.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="picQRCode.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 110</value>
</data>
<data name="picQRCode.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 200</value>
</data>
<data name="picQRCode.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
<value>Zoom</value>
</data>
<data name="picQRCode.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="&gt;&gt;picQRCode.Name" xml:space="preserve">
<value>picQRCode</value>
</data>
<data name="&gt;&gt;picQRCode.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;picQRCode.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;picQRCode.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="txtUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>432, 46</value>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>619, 310</value>
</data>
<data name="txtUrl.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>SubSettingControl</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View file

@ -117,18 +117,18 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnRemove.Text" xml:space="preserve">
<value>移除</value>
<data name="btnShare.Text" xml:space="preserve">
<value>分享</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="chkEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>48, 16</value>
</data>
<data name="chkEnabled.Text" xml:space="preserve">
<value>启用</value>
</data>
<data name="groupBox2.Text" xml:space="preserve">
<value>订阅详情</value>
<data name="btnRemove.Text" xml:space="preserve">
<value>移除</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value>
@ -142,4 +142,7 @@
<data name="label3.Text" xml:space="preserve">
<value>地址 (url)</value>
</data>
<data name="grbMain.Text" xml:space="preserve">
<value>订阅详情</value>
</data>
</root>

View file

@ -118,19 +118,61 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>448, 17</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>581, 629</value>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib">
<data name="&gt;&gt;btnClose.Name" xml:space="preserve">
<value>btnClose</value>
</data>
<data name="&gt;&gt;btnClose.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnClose.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;btnClose.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panCon.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Subscription settings</value>
<data name="panCon.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="panCon.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="panCon.Size" type="System.Drawing.Size, System.Drawing">
<value>614, 569</value>
</data>
<data name="panCon.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="&gt;&gt;panCon.Name" xml:space="preserve">
<value>panCon</value>
</data>
<data name="&gt;&gt;panCon.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panCon.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panCon.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnAdd.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -147,20 +189,17 @@
<data name="btnAdd.Text" xml:space="preserve">
<value>&amp;Add</value>
</data>
<data name="btnClose.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
<data name="&gt;&gt;btnAdd.Name" xml:space="preserve">
<value>btnAdd</value>
</data>
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
<value>448, 17</value>
<data name="&gt;&gt;btnAdd.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
<data name="&gt;&gt;btnAdd.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="btnClose.Text" xml:space="preserve">
<value>&amp;Cancel</value>
<data name="&gt;&gt;btnAdd.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="btnOK.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -177,20 +216,17 @@
<data name="btnOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="panCon.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
<data name="&gt;&gt;btnOK.Name" xml:space="preserve">
<value>btnOK</value>
</data>
<data name="panCon.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
<data name="&gt;&gt;btnOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="panCon.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
<data name="&gt;&gt;btnOK.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="panCon.Size" type="System.Drawing.Size, System.Drawing">
<value>581, 569</value>
</data>
<data name="panCon.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
@ -199,9 +235,39 @@
<value>0, 569</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>581, 60</value>
<value>614, 60</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 12</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>614, 629</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Subscription settings</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>SubSettingForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View file

@ -1,4 +1,6 @@

using System.Collections.Generic;
namespace v2rayN
{
class Global
@ -9,6 +11,9 @@ namespace v2rayN
public const string v2rayWebsiteUrl = @"https://www.v2fly.org/";
public const string AboutUrl = @"https://github.com/2dust/v2rayN";
public const string UpdateUrl = AboutUrl + @"/releases";
public const string v2flyCoreUrl = "https://github.com/v2fly/v2ray-core/releases";
public const string xrayCoreUrl = "https://github.com/XTLS/Xray-core/releases";
public const string NUrl = @"https://github.com/2dust/v2rayN/releases";
/// <summary>
@ -23,7 +28,6 @@ namespace v2rayN
/// </summary>
public const string CustomRoutingListUrl = @"https://raw.githubusercontent.com/2dust/v2rayCustomRoutingList/master/";
public const string GFWLIST_URL = "https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt";
/// <summary>
/// PromotionUrl
@ -56,10 +60,7 @@ namespace v2rayN
/// v2ray配置Httpresponse文件名
/// </summary>
public const string v2raySampleHttpresponseFileName = "v2rayN.Sample.SampleHttpresponse.txt";
/// <summary>
/// 空白的pac文件
/// </summary>
public const string BlankPacFileName = "v2rayN.Sample.BlankPac.txt";
public const string CustomRoutingFileName = "v2rayN.Sample.custom_routing_";
@ -161,11 +162,6 @@ namespace v2rayN
/// </summary>
public const string trojanProtocolLite = "trojan";
/// <summary>
/// pac
/// </summary>
public const string pacFILE = "pac.txt";
/// <summary>
/// email
/// </summary>
@ -195,6 +191,9 @@ namespace v2rayN
public const string IEProxyExceptions = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*";
public const string RoutingRuleComma = "<COMMA>";
public static readonly IEnumerable<string> ssSecuritys = new HashSet<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" };
#endregion
#region
@ -231,13 +230,6 @@ namespace v2rayN
get; set;
}
/// <summary>
/// PAC端口
/// </summary>
public static int pacPort
{
get; set;
}
/// <summary>
///

View file

@ -16,6 +16,8 @@ namespace v2rayN.Handler
{
private static string configRes = Global.ConfigFileName;
#region ConfigHandler
/// <summary>
/// 载入配置文件
/// </summary>
@ -87,22 +89,7 @@ namespace v2rayN.Handler
{
config.domainStrategy = "IPIfNonMatch";
}
if (Utils.IsNullOrEmpty(config.routingMode))
{
config.routingMode = "0";
}
if (config.useragent == null)
{
config.useragent = new List<string>();
}
if (config.userdirect == null)
{
config.userdirect = new List<string>();
}
if (config.userblock == null)
{
config.userblock = new List<string>();
}
//kcp
if (config.kcpItem == null)
{
@ -139,10 +126,6 @@ namespace v2rayN.Handler
{
config.speedPingTestUrl = Global.SpeedPingTestUrl;
}
if (Utils.IsNullOrEmpty(config.urlGFWList))
{
config.urlGFWList = Global.GFWLIST_URL;
}
//if (Utils.IsNullOrEmpty(config.remoteDNS))
//{
// config.remoteDNS = "1.1.1.1";
@ -152,10 +135,6 @@ namespace v2rayN.Handler
{
config.subItem = new List<SubItem>();
}
if (config.userPacRule == null)
{
config.userPacRule = new List<string>();
}
if (config == null
|| config.index < 0
@ -180,6 +159,10 @@ namespace v2rayN.Handler
return 0;
}
#endregion
#region Server
/// <summary>
/// 添加服务器或编辑
/// </summary>
@ -299,7 +282,9 @@ namespace v2rayN.Handler
path = config.vmess[index].path,
streamSecurity = config.vmess[index].streamSecurity,
allowInsecure = config.vmess[index].allowInsecure,
configType = config.vmess[index].configType
configType = config.vmess[index].configType,
flow = config.vmess[index].flow,
sni = config.vmess[index].sni
};
config.vmess.Insert(index + 1, vmessItem); // 插入到下一项
@ -358,95 +343,6 @@ namespace v2rayN.Handler
Utils.ToJsonFile(config, Utils.GetPath(configRes));
}
/// <summary>
/// 取得服务器QRCode配置
/// </summary>
/// <param name="config"></param>
/// <param name="index"></param>
/// <returns></returns>
public static string GetVmessQRCode(Config config, int index)
{
try
{
string url = string.Empty;
VmessItem vmessItem = config.vmess[index];
if (vmessItem.configType == (int)EConfigType.Vmess)
{
VmessQRCode vmessQRCode = new VmessQRCode
{
v = vmessItem.configVersion.ToString(),
ps = vmessItem.remarks.TrimEx(), //备注也许很长 ;
add = vmessItem.address,
port = vmessItem.port.ToString(),
id = vmessItem.id,
aid = vmessItem.alterId.ToString(),
net = vmessItem.network,
type = vmessItem.headerType,
host = vmessItem.requestHost,
path = vmessItem.path,
tls = vmessItem.streamSecurity
};
url = Utils.ToJson(vmessQRCode);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}", Global.vmessProtocol, url);
}
else if (vmessItem.configType == (int)EConfigType.Shadowsocks)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(vmessItem.remarks))
{
remark = "#" + WebUtility.UrlEncode(vmessItem.remarks);
}
url = string.Format("{0}:{1}@{2}:{3}",
vmessItem.security,
vmessItem.id,
vmessItem.address,
vmessItem.port);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}{2}", Global.ssProtocol, url, remark);
}
else if (vmessItem.configType == (int)EConfigType.Socks)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(vmessItem.remarks))
{
remark = "#" + WebUtility.UrlEncode(vmessItem.remarks);
}
url = string.Format("{0}:{1}@{2}:{3}",
vmessItem.security,
vmessItem.id,
vmessItem.address,
vmessItem.port);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}{2}", Global.socksProtocol, url, remark);
}
else if (vmessItem.configType == (int)EConfigType.Trojan)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(vmessItem.remarks))
{
remark = "#" + WebUtility.UrlEncode(vmessItem.remarks);
}
url = string.Format("{0}@{1}:{2}",
vmessItem.id,
vmessItem.address,
vmessItem.port);
url = string.Format("{0}{1}{2}", Global.trojanProtocol, url, remark);
}
else
{
}
return url;
}
catch
{
return "";
}
}
/// <summary>
/// 移动服务器
/// </summary>
@ -633,6 +529,11 @@ namespace v2rayN.Handler
vmessItem.id = vmessItem.id.TrimEx();
vmessItem.security = vmessItem.security.TrimEx();
if (!Global.ssSecuritys.Contains(vmessItem.security))
{
return -1;
}
if (index >= 0)
{
//修改
@ -714,7 +615,10 @@ namespace v2rayN.Handler
vmessItem.id = vmessItem.id.TrimEx();
vmessItem.streamSecurity = Global.StreamSecurity;
vmessItem.allowInsecure = "false";
if (Utils.IsNullOrEmpty(vmessItem.allowInsecure))
{
vmessItem.allowInsecure = config.defAllowInsecure.ToString();
}
if (index >= 0)
{
@ -838,7 +742,7 @@ namespace v2rayN.Handler
}
continue;
}
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(str, out string msg);
VmessItem vmessItem = ShareHandler.ImportFromClipboardConfig(str, out string msg);
if (vmessItem == null)
{
continue;
@ -872,6 +776,13 @@ namespace v2rayN.Handler
countServers++;
}
}
else if (vmessItem.configType == (int)EConfigType.VLESS)
{
if (AddVlessServer(ref config, vmessItem, -1) == 0)
{
countServers++;
}
}
}
return countServers;
}
@ -952,38 +863,6 @@ namespace v2rayN.Handler
return 0;
}
public static int AddformMainLvColWidth(ref Config config, string name, int width)
{
if (config.uiItem.mainLvColWidth == null)
{
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
}
if (config.uiItem.mainLvColWidth.ContainsKey(name))
{
config.uiItem.mainLvColWidth[name] = width;
}
else
{
config.uiItem.mainLvColWidth.Add(name, width);
}
return 0;
}
public static int GetformMainLvColWidth(ref Config config, string name, int width)
{
if (config.uiItem.mainLvColWidth == null)
{
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
}
if (config.uiItem.mainLvColWidth.ContainsKey(name))
{
return config.uiItem.mainLvColWidth[name];
}
else
{
return width;
}
}
public static int SortServers(ref Config config, EServerColName name, bool asc)
{
if (config.vmess.Count <= 0)
@ -1075,5 +954,252 @@ namespace v2rayN.Handler
return 0;
}
#endregion
#region UI
public static int AddformMainLvColWidth(ref Config config, string name, int width)
{
if (config.uiItem.mainLvColWidth == null)
{
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
}
if (config.uiItem.mainLvColWidth.ContainsKey(name))
{
config.uiItem.mainLvColWidth[name] = width;
}
else
{
config.uiItem.mainLvColWidth.Add(name, width);
}
return 0;
}
public static int GetformMainLvColWidth(ref Config config, string name, int width)
{
if (config.uiItem.mainLvColWidth == null)
{
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
}
if (config.uiItem.mainLvColWidth.ContainsKey(name))
{
return config.uiItem.mainLvColWidth[name];
}
else
{
return width;
}
}
#endregion
#region Routing
public static int SaveRouting(ref Config config)
{
if (config.routings == null)
{
return -1;
}
foreach (var item in config.routings)
{
}
//move locked item
int index = config.routings.FindIndex(it => it.locked == true);
if (index != -1)
{
var item = Utils.DeepCopy(config.routings[index]);
config.routings.RemoveAt(index);
config.routings.Add(item);
}
if (config.routingIndex >= config.routings.Count)
{
config.routingIndex = 0;
}
Global.reloadV2ray = true;
ToJsonFile(config);
return 0;
}
public static int AddRoutingItem(ref Config config, RoutingItem item, int index)
{
if (index >= 0)
{
config.routings[index] = item;
}
else
{
config.routings.Add(item);
}
ToJsonFile(config);
return 0;
}
/// <summary>
/// AddBatchRoutingRules
/// </summary>
/// <param name="config"></param>
/// <param name="clipboardData"></param>
/// <returns></returns>
public static int AddBatchRoutingRules(ref RoutingItem routingItem, string clipboardData)
{
if (Utils.IsNullOrEmpty(clipboardData))
{
return -1;
}
var lstRules = Utils.FromJson<List<RulesItem>>(clipboardData);
if (lstRules == null)
{
return -1;
}
routingItem.rules.Clear();
foreach (var item in lstRules)
{
routingItem.rules.Add(item);
}
return 0;
}
/// <summary>
/// MoveRoutingRule
/// </summary>
/// <param name="routingItem"></param>
/// <param name="index"></param>
/// <param name="eMove"></param>
/// <returns></returns>
public static int MoveRoutingRule(ref RoutingItem routingItem, int index, EMove eMove)
{
int count = routingItem.rules.Count;
if (index < 0 || index > routingItem.rules.Count - 1)
{
return -1;
}
switch (eMove)
{
case EMove.Top:
{
if (index == 0)
{
return 0;
}
var item = Utils.DeepCopy(routingItem.rules[index]);
routingItem.rules.RemoveAt(index);
routingItem.rules.Insert(0, item);
break;
}
case EMove.Up:
{
if (index == 0)
{
return 0;
}
var item = Utils.DeepCopy(routingItem.rules[index]);
routingItem.rules.RemoveAt(index);
routingItem.rules.Insert(index - 1, item);
break;
}
case EMove.Down:
{
if (index == count - 1)
{
return 0;
}
var item = Utils.DeepCopy(routingItem.rules[index]);
routingItem.rules.RemoveAt(index);
routingItem.rules.Insert(index + 1, item);
break;
}
case EMove.Bottom:
{
if (index == count - 1)
{
return 0;
}
var item = Utils.DeepCopy(routingItem.rules[index]);
routingItem.rules.RemoveAt(index);
routingItem.rules.Add(item);
break;
}
}
return 0;
}
public static int SetDefaultRouting(ref Config config, int index)
{
if (index < 0 || index > config.routings.Count - 1)
{
return -1;
}
////和现在相同
//if (config.index.Equals(index))
//{
// return -1;
//}
config.routingIndex = index;
Global.reloadV2ray = true;
ToJsonFile(config);
return 0;
}
public static int InitBuiltinRouting(ref Config config)
{
if (config.routings == null)
{
config.routings = new List<RoutingItem>();
}
if (config.routings.Count <= 0)
{
//Bypass the mainland
var item2 = new RoutingItem();
item2.remarks = "绕过大陆(Whitelist)";
item2.url = string.Empty;
item2.rules = new List<RulesItem>();
string result2 = Utils.GetEmbedText(Global.CustomRoutingFileName + "white");
AddBatchRoutingRules(ref item2, result2);
config.routings.Add(item2);
config.routingIndex = 0;
}
if (GetLockedRoutingItem(ref config) == null)
{
var item1 = new RoutingItem();
item1.remarks = "locked";
item1.url = string.Empty;
item1.rules = new List<RulesItem>();
item1.locked = true;
string result1 = Utils.GetEmbedText(Global.CustomRoutingFileName + "locked");
AddBatchRoutingRules(ref item1, result1);
config.routings.Add(item1);
}
SaveRouting(ref config);
return 0;
}
public static RoutingItem GetLockedRoutingItem(ref Config config)
{
if (config.routings == null)
{
return null;
}
return config.routings.Find(it => it.locked == true);
}
#endregion
}
}

View file

@ -52,10 +52,12 @@ namespace v2rayN.Handler
#region Check for updates
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/v2fly/v2ray-core/releases/latest";
private const string coreUrl = "https://github.com/v2fly/v2ray-core/releases/download/{0}/v2ray-windows-{1}.zip";
private readonly string nLatestUrl = Global.NUrl + "/latest";
private const string nUrl = Global.NUrl + "/download/{0}/v2rayN.zip";
private readonly string v2flyCoreLatestUrl = Global.v2flyCoreUrl + "/latest";
private const string v2flyCoreUrl = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip";
private readonly string xrayCoreLatestUrl = Global.xrayCoreUrl + "/latest";
private const string xrayCoreUrl = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip";
public async void CheckUpdateAsync(string type)
{
@ -67,9 +69,13 @@ namespace v2rayN.Handler
HttpClient httpClient = new HttpClient(webRequestHandler);
string url;
if (type == "Core")
if (type == "v2fly")
{
url = coreLatestUrl;
url = v2flyCoreLatestUrl;
}
else if (type == "xray")
{
url = xrayCoreLatestUrl;
}
else if (type == "v2rayN")
{
@ -94,14 +100,26 @@ namespace v2rayN.Handler
/// <summary>
/// 获取V2RayCore版本
/// </summary>
public string getV2rayVersion()
public string getCoreVersion(string type)
{
try
{
string filePath = Utils.GetPath("V2ray.exe");
var core = string.Empty;
var match = string.Empty;
if (type == "v2fly")
{
core = "v2ray.exe";
match = "V2Ray";
}
else if (type == "xray")
{
core = "xray.exe";
match = "Xray";
}
string filePath = Utils.GetPath(core);
if (!File.Exists(filePath))
{
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"https://github.com/v2fly/v2ray-core/releases");
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"");
//ShowMsg(true, msg);
return "";
}
@ -117,10 +135,9 @@ namespace v2rayN.Handler
p.Start();
p.WaitForExit(5000);
string echo = p.StandardOutput.ReadToEnd();
string version = Regex.Match(echo, "V2Ray ([0-9.]+) \\(").Groups[1].Value;
string version = Regex.Match(echo, $"{match} ([0-9.]+) \\(").Groups[1].Value;
return version;
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
@ -136,12 +153,19 @@ namespace v2rayN.Handler
string curVersion;
string message;
string url;
if (type == "Core")
if (type == "v2fly")
{
curVersion = "v" + getV2rayVersion();
curVersion = "v" + getCoreVersion(type);
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion);
string osBit = Environment.Is64BitProcess ? "64" : "32";
url = string.Format(coreUrl, version, osBit);
url = string.Format(v2flyCoreUrl, version, osBit);
}
else if (type == "xray")
{
curVersion = "v" + getCoreVersion(type);
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion);
string osBit = Environment.Is64BitProcess ? "64" : "32";
url = string.Format(xrayCoreUrl, version, osBit);
}
else if (type == "v2rayN")
{
@ -242,8 +266,8 @@ namespace v2rayN.Handler
{
((WebClientEx)sender).Dispose();
TimeSpan ts = (DateTime.Now - totalDatetime);
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.##"));
UpdateCompleted(this, new ResultEventArgs(true, speed));
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.0"));
UpdateCompleted(this, new ResultEventArgs(true, speed.PadLeft(8, ' ')));
return;
}
@ -252,8 +276,8 @@ namespace v2rayN.Handler
{
TimeSpan ts = (DateTime.Now - totalDatetime);
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.##"));
UpdateCompleted(this, new ResultEventArgs(true, speed));
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.0"));
UpdateCompleted(this, new ResultEventArgs(true, speed.PadLeft(8, ' ')));
}
else
{
@ -313,47 +337,24 @@ namespace v2rayN.Handler
}
}
#endregion
#region PAC
public string GenPacFile(string result)
public string WebDownloadStringSync(string url)
{
string source = string.Empty;
try
{
File.WriteAllText(Utils.GetTempPath("gfwlist.txt"), result, Encoding.UTF8);
List<string> lines = ParsePacResult(result);
string abpContent = Utils.UnGzip(Resources.abp_js);
abpContent = abpContent.Replace("__RULES__", JsonConvert.SerializeObject(lines, Formatting.Indented));
File.WriteAllText(Utils.GetPath(Global.pacFILE), abpContent, Encoding.UTF8);
Utils.SetSecurityProtocol();
WebClientEx ws = new WebClientEx();
return ws.DownloadString(new Uri(url));
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
return ex.Message;
}
return string.Empty;
}
private List<string> ParsePacResult(string response)
{
IEnumerable<char> IgnoredLineBegins = new[] { '!', '[' };
byte[] bytes = Convert.FromBase64String(response);
string content = Encoding.UTF8.GetString(bytes);
List<string> valid_lines = new List<string>();
using (StringReader sr = new StringReader(content))
{
foreach (string line in sr.NonWhiteSpaceLines())
{
if (line.BeginWithAny(IgnoredLineBegins))
continue;
valid_lines.Add(line);
}
}
return valid_lines;
}
#endregion
}
}

View file

@ -1,6 +1,7 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
@ -8,6 +9,7 @@ namespace v2rayN.Handler
class MainFormHandler
{
private static MainFormHandler instance;
Action<bool, string> updateUI;
//private DownloadHandle downloadHandle2;
//private Config _config;
@ -32,7 +34,7 @@ namespace v2rayN.Handler
try
{
Color color = ColorTranslator.FromHtml("#3399CC");
int index = (int)config.listenerType;
int index = (int)config.sysProxyType;
if (index > 0)
{
color = (new Color[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange, Color.DarkSlateBlue, Color.RoyalBlue })[index - 1];
@ -147,6 +149,93 @@ namespace v2rayN.Handler
}
}
public int AddBatchServers(Config config, string clipboardData, string subid = "")
{
int counter;
int _Add()
{
return ConfigHandler.AddBatchServers(ref config, clipboardData, subid);
}
counter = _Add();
if (counter < 1)
{
clipboardData = Utils.Base64Decode(clipboardData);
counter = _Add();
}
return counter;
}
public void UpdateSubscriptionProcess(Config config, Action<bool, string> update)
{
updateUI = update;
updateUI(false, UIRes.I18N("MsgUpdateSubscriptionStart"));
if (config.subItem == null || config.subItem.Count <= 0)
{
updateUI(false, UIRes.I18N("MsgNoValidSubscription"));
return;
}
for (int k = 1; k <= config.subItem.Count; k++)
{
string id = config.subItem[k - 1].id.TrimEx();
string url = config.subItem[k - 1].url.TrimEx();
string hashCode = $"{k}->";
if (config.subItem[k - 1].enabled == false)
{
continue;
}
if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url))
{
updateUI(false, $"{hashCode}{UIRes.I18N("MsgNoValidSubscription")}");
continue;
}
DownloadHandle downloadHandle3 = new DownloadHandle();
downloadHandle3.UpdateCompleted += (sender2, args) =>
{
if (args.Success)
{
updateUI(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}");
string result = Utils.Base64Decode(args.Msg);
if (Utils.IsNullOrEmpty(result))
{
updateUI(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}");
return;
}
ConfigHandler.RemoveServerViaSubid(ref config, id);
updateUI(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}");
// RefreshServers();
int ret = MainFormHandler.Instance.AddBatchServers(config, result, id);
if (ret > 0)
{
// RefreshServers();
}
else
{
updateUI(false, $"{hashCode}{UIRes.I18N("MsgFailedImportSubscription")}");
}
updateUI(true, $"{hashCode}{UIRes.I18N("MsgUpdateSubscriptionEnd")}");
}
else
{
updateUI(false, args.Msg);
}
};
downloadHandle3.Error += (sender2, args) =>
{
updateUI(false, args.GetException().Message);
};
downloadHandle3.WebDownloadString(url);
updateUI(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}");
}
}
}
}

View file

@ -0,0 +1,694 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
{
class ShareHandler
{
#region GetShareUrl
/// <summary>
/// GetShareUrl
/// </summary>
/// <param name="config"></param>
/// <param name="index"></param>
/// <returns></returns>
public static string GetShareUrl(Config config, int index)
{
try
{
string url = string.Empty;
VmessItem item = config.vmess[index];
if (item.configType == (int)EConfigType.Vmess)
{
VmessQRCode vmessQRCode = new VmessQRCode
{
v = item.configVersion.ToString(),
ps = item.remarks.TrimEx(), //备注也许很长 ;
add = item.address,
port = item.port.ToString(),
id = item.id,
aid = item.alterId.ToString(),
net = item.network,
type = item.headerType,
host = item.requestHost,
path = item.path,
tls = item.streamSecurity,
sni = item.sni
};
url = Utils.ToJson(vmessQRCode);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}", Global.vmessProtocol, url);
}
else if (item.configType == (int)EConfigType.Shadowsocks)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(item.remarks))
{
remark = "#" + Utils.UrlEncode(item.remarks);
}
url = string.Format("{0}:{1}@{2}:{3}",
item.security,
item.id,
item.address,
item.port);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}{2}", Global.ssProtocol, url, remark);
}
else if (item.configType == (int)EConfigType.Socks)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(item.remarks))
{
remark = "#" + Utils.UrlEncode(item.remarks);
}
url = string.Format("{0}:{1}@{2}:{3}",
item.security,
item.id,
item.address,
item.port);
url = Utils.Base64Encode(url);
url = string.Format("{0}{1}{2}", Global.socksProtocol, url, remark);
}
else if (item.configType == (int)EConfigType.Trojan)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(item.remarks))
{
remark = "#" + Utils.UrlEncode(item.remarks);
}
string query = string.Empty;
if (!Utils.IsNullOrEmpty(item.sni))
{
query = string.Format("?sni={0}", Utils.UrlEncode(item.sni));
}
url = string.Format("{0}@{1}:{2}",
item.id,
GetIpv6(item.address),
item.port);
url = string.Format("{0}{1}{2}{3}", Global.trojanProtocol, url, query, remark);
}
else if (item.configType == (int)EConfigType.VLESS)
{
string remark = string.Empty;
if (!Utils.IsNullOrEmpty(item.remarks))
{
remark = "#" + Utils.UrlEncode(item.remarks);
}
var dicQuery = new Dictionary<string, string>();
if (!Utils.IsNullOrEmpty(item.flow))
{
dicQuery.Add("flow", item.flow);
}
if (!Utils.IsNullOrEmpty(item.security))
{
dicQuery.Add("encryption", item.security);
}
else
{
dicQuery.Add("encryption", "none");
}
if (!Utils.IsNullOrEmpty(item.streamSecurity))
{
dicQuery.Add("security", item.streamSecurity);
}
else
{
dicQuery.Add("security", "none");
}
if (!Utils.IsNullOrEmpty(item.sni))
{
dicQuery.Add("sni", item.sni);
}
if (!Utils.IsNullOrEmpty(item.network))
{
dicQuery.Add("type", item.network);
}
else
{
dicQuery.Add("type", "tcp");
}
switch (item.network)
{
case "tcp":
if (!Utils.IsNullOrEmpty(item.headerType))
{
dicQuery.Add("headerType", item.headerType);
}
else
{
dicQuery.Add("headerType", "none");
}
if (!Utils.IsNullOrEmpty(item.requestHost))
{
dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
}
break;
case "kcp":
if (!Utils.IsNullOrEmpty(item.headerType))
{
dicQuery.Add("headerType", item.headerType);
}
else
{
dicQuery.Add("headerType", "none");
}
if (!Utils.IsNullOrEmpty(item.path))
{
dicQuery.Add("seed", Utils.UrlEncode(item.path));
}
break;
case "ws":
if (!Utils.IsNullOrEmpty(item.requestHost))
{
dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
}
if (!Utils.IsNullOrEmpty(item.path))
{
dicQuery.Add("path", Utils.UrlEncode(item.path));
}
break;
case "http":
case "h2":
dicQuery["type"] = "http";
if (!Utils.IsNullOrEmpty(item.requestHost))
{
dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
}
if (!Utils.IsNullOrEmpty(item.path))
{
dicQuery.Add("path", Utils.UrlEncode(item.path));
}
break;
case "quic":
if (!Utils.IsNullOrEmpty(item.headerType))
{
dicQuery.Add("headerType", item.headerType);
}
else
{
dicQuery.Add("headerType", "none");
}
dicQuery.Add("quicSecurity", Utils.UrlEncode(item.requestHost));
dicQuery.Add("key", Utils.UrlEncode(item.path));
break;
}
string query = "?" + string.Join("&", dicQuery.Select(x => x.Key + "=" + x.Value).ToArray());
url = string.Format("{0}@{1}:{2}",
item.id,
GetIpv6(item.address),
item.port);
url = string.Format("{0}{1}{2}{3}", Global.vlessProtocol, url, query, remark);
}
else
{
}
return url;
}
catch
{
return "";
}
}
private static string GetIpv6(string address)
{
return Utils.IsIpv6(address) ? $"[{address}]" : address;
}
#endregion
#region ImportShareUrl
/// <summary>
/// 从剪贴板导入URL
/// </summary>
/// <param name="fileName"></param>
/// <param name="msg"></param>
/// <returns></returns>
public static VmessItem ImportFromClipboardConfig(string clipboardData, out string msg)
{
msg = string.Empty;
VmessItem vmessItem = new VmessItem();
try
{
//载入配置文件
string result = clipboardData.TrimEx();// Utils.GetClipboardData();
if (Utils.IsNullOrEmpty(result))
{
msg = UIRes.I18N("FailedReadConfiguration");
return null;
}
if (result.StartsWith(Global.vmessProtocol))
{
int indexSplit = result.IndexOf("?");
if (indexSplit > 0)
{
vmessItem = ResolveStdVmess(result) ?? ResolveVmess4Kitsunebi(result);
}
else
{
vmessItem.configType = (int)EConfigType.Vmess;
result = result.Substring(Global.vmessProtocol.Length);
result = Utils.Base64Decode(result);
//转成Json
VmessQRCode vmessQRCode = Utils.FromJson<VmessQRCode>(result);
if (vmessQRCode == null)
{
msg = UIRes.I18N("FailedConversionConfiguration");
return null;
}
vmessItem.security = Global.DefaultSecurity;
vmessItem.network = Global.DefaultNetwork;
vmessItem.headerType = Global.None;
vmessItem.configVersion = Utils.ToInt(vmessQRCode.v);
vmessItem.remarks = Utils.ToString(vmessQRCode.ps);
vmessItem.address = Utils.ToString(vmessQRCode.add);
vmessItem.port = Utils.ToInt(vmessQRCode.port);
vmessItem.id = Utils.ToString(vmessQRCode.id);
vmessItem.alterId = Utils.ToInt(vmessQRCode.aid);
if (!Utils.IsNullOrEmpty(vmessQRCode.net))
{
vmessItem.network = vmessQRCode.net;
}
if (!Utils.IsNullOrEmpty(vmessQRCode.type))
{
vmessItem.headerType = vmessQRCode.type;
}
vmessItem.requestHost = Utils.ToString(vmessQRCode.host);
vmessItem.path = Utils.ToString(vmessQRCode.path);
vmessItem.streamSecurity = Utils.ToString(vmessQRCode.tls);
vmessItem.sni = Utils.ToString(vmessQRCode.sni);
}
ConfigHandler.UpgradeServerVersion(ref vmessItem);
}
else if (result.StartsWith(Global.ssProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem = ResolveSSLegacy(result);
if (vmessItem == null)
{
vmessItem = ResolveSip002(result);
}
if (vmessItem == null)
{
return null;
}
if (vmessItem.address.Length == 0 || vmessItem.port == 0 || vmessItem.security.Length == 0 || vmessItem.id.Length == 0)
{
return null;
}
vmessItem.configType = (int)EConfigType.Shadowsocks;
}
else if (result.StartsWith(Global.socksProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem.configType = (int)EConfigType.Socks;
result = result.Substring(Global.socksProtocol.Length);
//remark
int indexRemark = result.IndexOf("#");
if (indexRemark > 0)
{
try
{
vmessItem.remarks = Utils.UrlDecode(result.Substring(indexRemark + 1, result.Length - indexRemark - 1));
}
catch { }
result = result.Substring(0, indexRemark);
}
//part decode
int indexS = result.IndexOf("@");
if (indexS > 0)
{
}
else
{
result = Utils.Base64Decode(result);
}
string[] arr1 = result.Split('@');
if (arr1.Length != 2)
{
return null;
}
string[] arr21 = arr1[0].Split(':');
//string[] arr22 = arr1[1].Split(':');
int indexPort = arr1[1].LastIndexOf(":");
if (arr21.Length != 2 || indexPort < 0)
{
return null;
}
vmessItem.address = arr1[1].Substring(0, indexPort);
vmessItem.port = Utils.ToInt(arr1[1].Substring(indexPort + 1, arr1[1].Length - (indexPort + 1)));
vmessItem.security = arr21[0];
vmessItem.id = arr21[1];
}
else if (result.StartsWith(Global.trojanProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem.configType = (int)EConfigType.Trojan;
Uri uri = new Uri(result);
vmessItem.address = uri.IdnHost;
vmessItem.port = uri.Port;
vmessItem.id = uri.UserInfo;
var qurery = HttpUtility.ParseQueryString(uri.Query);
vmessItem.sni = qurery["sni"] ?? "";
var remarks = uri.Fragment.Replace("#", "");
if (Utils.IsNullOrEmpty(remarks))
{
vmessItem.remarks = "NONE";
}
else
{
vmessItem.remarks = Utils.UrlDecode(remarks);
}
}
else if (result.StartsWith(Global.vlessProtocol))
{
vmessItem = ResolveStdVLESS(result);
ConfigHandler.UpgradeServerVersion(ref vmessItem);
}
else
{
msg = UIRes.I18N("NonvmessOrssProtocol");
return null;
}
}
catch
{
msg = UIRes.I18N("Incorrectconfiguration");
return null;
}
return vmessItem;
}
private static VmessItem ResolveVmess4Kitsunebi(string result)
{
VmessItem vmessItem = new VmessItem
{
configType = (int)EConfigType.Vmess
};
result = result.Substring(Global.vmessProtocol.Length);
int indexSplit = result.IndexOf("?");
if (indexSplit > 0)
{
result = result.Substring(0, indexSplit);
}
result = Utils.Base64Decode(result);
string[] arr1 = result.Split('@');
if (arr1.Length != 2)
{
return null;
}
string[] arr21 = arr1[0].Split(':');
string[] arr22 = arr1[1].Split(':');
if (arr21.Length != 2 || arr21.Length != 2)
{
return null;
}
vmessItem.address = arr22[0];
vmessItem.port = Utils.ToInt(arr22[1]);
vmessItem.security = arr21[0];
vmessItem.id = arr21[1];
vmessItem.network = Global.DefaultNetwork;
vmessItem.headerType = Global.None;
vmessItem.remarks = "Alien";
vmessItem.alterId = 0;
return vmessItem;
}
private static VmessItem ResolveSip002(string result)
{
Uri parsedUrl;
try
{
parsedUrl = new Uri(result);
}
catch (UriFormatException)
{
return null;
}
VmessItem server = new VmessItem
{
remarks = parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped),
address = parsedUrl.IdnHost,
port = parsedUrl.Port,
};
// parse base64 UserInfo
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.Unescaped);
string base64 = rawUserInfo.Replace('-', '+').Replace('_', '/'); // Web-safe base64 to normal base64
string userInfo;
try
{
userInfo = Encoding.UTF8.GetString(Convert.FromBase64String(
base64.PadRight(base64.Length + (4 - base64.Length % 4) % 4, '=')));
}
catch (FormatException)
{
return null;
}
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2);
if (userInfoParts.Length != 2)
{
return null;
}
server.security = userInfoParts[0];
server.id = userInfoParts[1];
NameValueCollection queryParameters = HttpUtility.ParseQueryString(parsedUrl.Query);
if (queryParameters["plugin"] != null)
{
return null;
}
return server;
}
private static readonly Regex UrlFinder = new Regex(@"ss://(?<base64>[A-Za-z0-9+-/=_]+)(?:#(?<tag>\S+))?", RegexOptions.IgnoreCase);
private static readonly Regex DetailsParser = new Regex(@"^((?<method>.+?):(?<password>.*)@(?<hostname>.+?):(?<port>\d+?))$", RegexOptions.IgnoreCase);
private static VmessItem ResolveSSLegacy(string result)
{
var match = UrlFinder.Match(result);
if (!match.Success)
return null;
VmessItem server = new VmessItem();
var base64 = match.Groups["base64"].Value.TrimEnd('/');
var tag = match.Groups["tag"].Value;
if (!Utils.IsNullOrEmpty(tag))
{
server.remarks = Utils.UrlDecode(tag);
}
Match details;
try
{
details = DetailsParser.Match(Encoding.UTF8.GetString(Convert.FromBase64String(
base64.PadRight(base64.Length + (4 - base64.Length % 4) % 4, '='))));
}
catch (FormatException)
{
return null;
}
if (!details.Success)
return null;
server.security = details.Groups["method"].Value;
server.id = details.Groups["password"].Value;
server.address = details.Groups["hostname"].Value;
server.port = int.Parse(details.Groups["port"].Value);
return server;
}
private static readonly Regex StdVmessUserInfo = new Regex(
@"^(?<network>[a-z]+)(\+(?<streamSecurity>[a-z]+))?:(?<id>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})-(?<alterId>[0-9]+)$");
private static VmessItem ResolveStdVmess(string result)
{
VmessItem i = new VmessItem
{
configType = (int)EConfigType.Vmess,
security = "auto"
};
Uri u = new Uri(result);
i.address = u.IdnHost;
i.port = u.Port;
i.remarks = u.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
var q = HttpUtility.ParseQueryString(u.Query);
var m = StdVmessUserInfo.Match(u.UserInfo);
if (!m.Success) return null;
i.id = m.Groups["id"].Value;
if (!int.TryParse(m.Groups["alterId"].Value, out int aid))
{
return null;
}
i.alterId = aid;
if (m.Groups["streamSecurity"].Success)
{
i.streamSecurity = m.Groups["streamSecurity"].Value;
}
switch (i.streamSecurity)
{
case "tls":
// TODO tls config
break;
default:
if (!string.IsNullOrWhiteSpace(i.streamSecurity))
return null;
break;
}
i.network = m.Groups["network"].Value;
switch (i.network)
{
case "tcp":
string t1 = q["type"] ?? "none";
i.headerType = t1;
// TODO http option
break;
case "kcp":
i.headerType = q["type"] ?? "none";
// TODO kcp seed
break;
case "ws":
string p1 = q["path"] ?? "/";
string h1 = q["host"] ?? "";
i.requestHost = Utils.UrlDecode(h1);
i.path = p1;
break;
case "http":
case "h2":
i.network = "h2";
string p2 = q["path"] ?? "/";
string h2 = q["host"] ?? "";
i.requestHost = Utils.UrlDecode(h2);
i.path = p2;
break;
case "quic":
string s = q["security"] ?? "none";
string k = q["key"] ?? "";
string t3 = q["type"] ?? "none";
i.headerType = t3;
i.requestHost = Utils.UrlDecode(s);
i.path = k;
break;
default:
return null;
}
return i;
}
private static VmessItem ResolveStdVLESS(string result)
{
VmessItem item = new VmessItem
{
configType = (int)EConfigType.VLESS,
security = "none"
};
Uri url = new Uri(result);
item.address = url.IdnHost;
item.port = url.Port;
item.remarks = url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
item.id = url.UserInfo;
var query = HttpUtility.ParseQueryString(url.Query);
item.flow = query["flow"] ?? "";
item.security = query["encryption"] ?? "none";
item.streamSecurity = query["security"] ?? "";
item.sni = query["sni"] ?? "";
item.network = query["type"] ?? "tcp";
switch (item.network)
{
case "tcp":
item.headerType = query["headerType"] ?? "none";
item.requestHost = Utils.UrlDecode(query["host"] ?? "");
break;
case "kcp":
item.headerType = query["headerType"] ?? "none";
item.path = Utils.UrlDecode(query["seed"] ?? "");
break;
case "ws":
item.requestHost = Utils.UrlDecode(query["host"] ?? "");
item.path = Utils.UrlDecode(query["path"] ?? "/");
break;
case "http":
case "h2":
item.network = "h2";
item.requestHost = Utils.UrlDecode(query["host"] ?? "");
item.path = Utils.UrlDecode(query["path"] ?? "/");
break;
case "quic":
item.headerType = query["headerType"] ?? "none";
item.requestHost = query["quicSecurity"] ?? "none";
item.path = Utils.UrlDecode(query["key"] ?? "");
break;
default:
return null;
}
return item;
}
#endregion
}
}

View file

@ -289,7 +289,7 @@ namespace v2rayN.Handler
{
return "Timeout";
}
return string.Format("{0}{1}", time, unit).PadLeft(6, ' ');
return string.Format("{0}{1}", time, unit).PadLeft(8, ' ');
}
}
}

View file

@ -30,6 +30,7 @@ namespace v2rayN.Handler
get; set;
}
public List<ServerStatItem> Statistic
{
get
@ -191,6 +192,25 @@ namespace v2rayN.Handler
}
}
public void ClearAllServerStatistics()
{
if (serverStatistics_ != null)
{
foreach (var item in serverStatistics_.server)
{
item.todayUp = 0;
item.todayDown = 0;
item.totalUp = 0;
item.totalDown = 0;
// update ui display to zero
updateFunc_(0, 0, new List<ServerStatItem> { item });
}
// update statistic json file
SaveToFile();
}
}
private ServerStatItem GetServerStatItem(string itemId)
{
long ticks = DateTime.Now.Date.Ticks;

View file

@ -1,13 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
@ -84,7 +78,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());
}
@ -152,7 +146,7 @@ namespace v2rayN.Handler
try
{
Inbounds inbound = v2rayConfig.inbounds[0];
//端口
inbound.tag = Global.InboundSocks;
inbound.port = config.inbound[0].localPort;
inbound.protocol = config.inbound[0].protocol;
if (config.allowLANConn)
@ -163,9 +157,17 @@ namespace v2rayN.Handler
{
inbound.listen = Global.Loopback;
}
//开启udp
//udp
inbound.settings.udp = config.inbound[0].udpEnabled;
inbound.sniffing.enabled = config.inbound[0].sniffingEnabled;
//http
Inbounds inbound2 = v2rayConfig.inbounds[1];
inbound2.tag = Global.InboundHttp;
inbound2.port = config.GetLocalPort(Global.InboundHttp);
inbound2.protocol = Global.InboundHttp;
inbound2.listen = inbound.listen;
inbound2.settings.allowTransparent = false;
}
catch
{
@ -188,31 +190,27 @@ namespace v2rayN.Handler
{
v2rayConfig.routing.domainStrategy = config.domainStrategy;
//自定义
//需代理
routingUserRule(config.useragent, Global.agentTag, ref v2rayConfig);
//直连
routingUserRule(config.userdirect, Global.directTag, ref v2rayConfig);
//阻止
routingUserRule(config.userblock, Global.blockTag, ref v2rayConfig);
switch (config.routingMode)
if (config.enableRoutingAdvanced)
{
case "0":
break;
case "1":
routingGeo("ip", "private", Global.directTag, ref v2rayConfig);
break;
case "2":
routingGeo("", "cn", Global.directTag, ref v2rayConfig);
break;
case "3":
routingGeo("ip", "private", Global.directTag, ref v2rayConfig);
routingGeo("", "cn", Global.directTag, ref v2rayConfig);
break;
if (config.routings != null && config.routingIndex < config.routings.Count)
{
foreach (var item in config.routings[config.routingIndex].rules)
{
routingUserRule(item, ref v2rayConfig);
}
}
}
else
{
var lockedItem = ConfigHandler.GetLockedRoutingItem(ref config);
if (lockedItem != null)
{
foreach (var item in lockedItem.rules)
{
routingUserRule(item, ref v2rayConfig);
}
}
}
}
}
catch
@ -220,96 +218,93 @@ namespace v2rayN.Handler
}
return 0;
}
private static int routingUserRule(List<string> userRule, string tag, ref V2rayConfig v2rayConfig)
private static int routingUserRule(RulesItem rules, ref V2rayConfig v2rayConfig)
{
try
{
if (userRule != null
&& userRule.Count > 0)
if (rules == null)
{
//Domain
RulesItem rulesDomain = new RulesItem
{
type = "field",
outboundTag = tag,
domain = new List<string>()
};
//IP
RulesItem rulesIP = new RulesItem
{
type = "field",
outboundTag = tag,
ip = new List<string>()
};
foreach (string u in userRule)
{
string url = u.TrimEx();
if (Utils.IsNullOrEmpty(url))
{
continue;
}
if (Utils.IsIP(url) || url.StartsWith("geoip:"))
{
rulesIP.ip.Add(url);
}
else if (Utils.IsDomain(url)
|| url.StartsWith("geosite:")
|| url.StartsWith("regexp:")
|| url.StartsWith("domain:")
|| url.StartsWith("full:"))
{
rulesDomain.domain.Add(url);
}
}
if (rulesDomain.domain.Count > 0)
{
v2rayConfig.routing.rules.Add(rulesDomain);
}
if (rulesIP.ip.Count > 0)
{
v2rayConfig.routing.rules.Add(rulesIP);
}
}
}
catch
{
}
return 0;
}
private static int routingGeo(string ipOrDomain, string code, string tag, ref V2rayConfig v2rayConfig)
if (Utils.IsNullOrEmpty(rules.port))
{
try
rules.port = null;
}
if (rules.domain != null && rules.domain.Count == 0)
{
if (!Utils.IsNullOrEmpty(code))
rules.domain = null;
}
if (rules.ip != null && rules.ip.Count == 0)
{
//IP
if (ipOrDomain == "ip" || ipOrDomain == "")
rules.ip = null;
}
if (rules.protocol != null && rules.protocol.Count == 0)
{
RulesItem rulesItem = new RulesItem
{
type = "field",
outboundTag = Global.directTag,
ip = new List<string>()
};
rulesItem.ip.Add($"geoip:{code}");
v2rayConfig.routing.rules.Add(rulesItem);
rules.protocol = null;
}
if (ipOrDomain == "domain" || ipOrDomain == "")
var hasDomainIp = false;
if (rules.domain != null && rules.domain.Count > 0)
{
RulesItem rulesItem = new RulesItem
var it = Utils.DeepCopy(rules);
it.ip = null;
it.type = "field";
for (int k = 0; k < it.domain.Count; k++)
{
type = "field",
outboundTag = Global.directTag,
domain = new List<string>()
};
rulesItem.domain.Add($"geosite:{code}");
v2rayConfig.routing.rules.Add(rulesItem);
it.domain[k] = it.domain[k].Replace(Global.RoutingRuleComma, ",");
}
//if (Utils.IsNullOrEmpty(it.port))
//{
// it.port = null;
//}
//if (it.protocol != null && it.protocol.Count == 0)
//{
// it.protocol = null;
//}
v2rayConfig.routing.rules.Add(it);
hasDomainIp = true;
}
if (rules.ip != null && rules.ip.Count > 0)
{
var it = Utils.DeepCopy(rules);
it.domain = null;
it.type = "field";
//if (Utils.IsNullOrEmpty(it.port))
//{
// it.port = null;
//}
//if (it.protocol != null && it.protocol.Count == 0)
//{
// it.protocol = null;
//}
v2rayConfig.routing.rules.Add(it);
hasDomainIp = true;
}
if (!hasDomainIp)
{
if (!Utils.IsNullOrEmpty(rules.port))
{
var it = Utils.DeepCopy(rules);
//it.domain = null;
//it.ip = null;
//if (it.protocol != null && it.protocol.Count == 0)
//{
// it.protocol = null;
//}
it.type = "field";
v2rayConfig.routing.rules.Add(it);
}
else if (rules.protocol != null && rules.protocol.Count > 0)
{
var it = Utils.DeepCopy(rules);
//it.domain = null;
//it.ip = null;
//if (Utils.IsNullOrEmpty(it.port))
//{
// it.port = null;
//}
it.type = "field";
v2rayConfig.routing.rules.Add(it);
}
}
}
@ -389,7 +384,15 @@ namespace v2rayN.Handler
serversItem.address = config.address();
serversItem.port = config.port();
serversItem.password = config.id();
if (Global.ssSecuritys.Contains(config.security()))
{
serversItem.method = config.security();
}
else
{
serversItem.method = "none";
}
serversItem.ota = false;
serversItem.level = 1;
@ -488,7 +491,7 @@ namespace v2rayN.Handler
}
else
{
usersItem.flow = config.flow();
usersItem.flow = config.flow().Replace("splice", "direct");
}
outbound.mux.enabled = false;
@ -550,6 +553,8 @@ namespace v2rayN.Handler
//远程服务器底层传输配置
streamSettings.network = config.network();
string host = config.requestHost();
string sni = config.sni();
//if tls
if (config.streamSecurity() == Global.StreamSecurity)
{
@ -559,9 +564,13 @@ namespace v2rayN.Handler
{
allowInsecure = config.allowInsecure()
};
if (!string.IsNullOrWhiteSpace(host))
if (!string.IsNullOrWhiteSpace(sni))
{
tlsSettings.serverName = host;
tlsSettings.serverName = sni;
}
else if (!string.IsNullOrWhiteSpace(host))
{
tlsSettings.serverName = Utils.String2List(host)[0];
}
streamSettings.tlsSettings = tlsSettings;
}
@ -575,9 +584,13 @@ namespace v2rayN.Handler
{
allowInsecure = config.allowInsecure()
};
if (!string.IsNullOrWhiteSpace(host))
if (!string.IsNullOrWhiteSpace(sni))
{
xtlsSettings.serverName = host;
xtlsSettings.serverName = sni;
}
else if (!string.IsNullOrWhiteSpace(host))
{
xtlsSettings.serverName = Utils.String2List(host)[0];
}
streamSettings.xtlsSettings = xtlsSettings;
}
@ -625,7 +638,6 @@ namespace v2rayN.Handler
case "ws":
WsSettings wsSettings = new WsSettings
{
connectionReuse = true
};
string path = config.path();
@ -679,9 +691,22 @@ namespace v2rayN.Handler
};
streamSettings.quicSettings = quicsettings;
if (config.streamSecurity() == Global.StreamSecurity)
{
if (!string.IsNullOrWhiteSpace(sni))
{
streamSettings.tlsSettings.serverName = sni;
}
else
{
streamSettings.tlsSettings.serverName = config.address();
}
}
break;
case "grpc":
var grpcSettings = new GrpcSettings();
grpcSettings.serviceName = config.path();
streamSettings.grpcSettings = grpcSettings;
break;
default:
//tcp带http伪装
@ -689,7 +714,6 @@ namespace v2rayN.Handler
{
TcpSettings tcpSettings = new TcpSettings
{
connectionReuse = true,
header = new Header
{
type = config.headerType()
@ -746,6 +770,14 @@ namespace v2rayN.Handler
{
return 0;
}
var obj = Utils.ParseJson(config.remoteDNS);
if (obj != null && obj.ContainsKey("servers"))
{
v2rayConfig.dns = obj;
}
else
{
List<string> servers = new List<string>();
string[] arrDNS = config.remoteDNS.Split(',');
@ -762,6 +794,7 @@ namespace v2rayN.Handler
servers = servers
};
}
}
catch
{
}
@ -785,8 +818,8 @@ namespace v2rayN.Handler
apiObj.services = services.ToList();
v2rayConfig.api = apiObj;
policySystemSetting.statsInboundDownlink = true;
policySystemSetting.statsInboundUplink = true;
policySystemSetting.statsOutboundDownlink = true;
policySystemSetting.statsOutboundUplink = true;
policyObj.system = policySystemSetting;
v2rayConfig.policy = policyObj;
@ -919,7 +952,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());
}
@ -1297,176 +1330,6 @@ namespace v2rayN.Handler
return vmessItem;
}
/// <summary>
/// 从剪贴板导入URL
/// </summary>
/// <param name="fileName"></param>
/// <param name="msg"></param>
/// <returns></returns>
public static VmessItem ImportFromClipboardConfig(string clipboardData, out string msg)
{
msg = string.Empty;
VmessItem vmessItem = new VmessItem();
try
{
//载入配置文件
string result = clipboardData.TrimEx();// Utils.GetClipboardData();
if (Utils.IsNullOrEmpty(result))
{
msg = UIRes.I18N("FailedReadConfiguration");
return null;
}
if (result.StartsWith(Global.vmessProtocol))
{
int indexSplit = result.IndexOf("?");
if (indexSplit > 0)
{
vmessItem = ResolveStdVmess(result) ?? ResolveVmess4Kitsunebi(result);
}
else
{
vmessItem.configType = (int)EConfigType.Vmess;
result = result.Substring(Global.vmessProtocol.Length);
result = Utils.Base64Decode(result);
//转成Json
VmessQRCode vmessQRCode = Utils.FromJson<VmessQRCode>(result);
if (vmessQRCode == null)
{
msg = UIRes.I18N("FailedConversionConfiguration");
return null;
}
vmessItem.security = Global.DefaultSecurity;
vmessItem.network = Global.DefaultNetwork;
vmessItem.headerType = Global.None;
vmessItem.configVersion = Utils.ToInt(vmessQRCode.v);
vmessItem.remarks = Utils.ToString(vmessQRCode.ps);
vmessItem.address = Utils.ToString(vmessQRCode.add);
vmessItem.port = Utils.ToInt(vmessQRCode.port);
vmessItem.id = Utils.ToString(vmessQRCode.id);
vmessItem.alterId = Utils.ToInt(vmessQRCode.aid);
if (!Utils.IsNullOrEmpty(vmessQRCode.net))
{
vmessItem.network = vmessQRCode.net;
}
if (!Utils.IsNullOrEmpty(vmessQRCode.type))
{
vmessItem.headerType = vmessQRCode.type;
}
vmessItem.requestHost = Utils.ToString(vmessQRCode.host);
vmessItem.path = Utils.ToString(vmessQRCode.path);
vmessItem.streamSecurity = Utils.ToString(vmessQRCode.tls);
}
ConfigHandler.UpgradeServerVersion(ref vmessItem);
}
else if (result.StartsWith(Global.ssProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem = ResolveSSLegacy(result);
if (vmessItem == null)
{
vmessItem = ResolveSip002(result);
}
if (vmessItem == null)
{
return null;
}
if (vmessItem.address.Length == 0 || vmessItem.port == 0 || vmessItem.security.Length == 0 || vmessItem.id.Length == 0)
{
return null;
}
vmessItem.configType = (int)EConfigType.Shadowsocks;
}
else if (result.StartsWith(Global.socksProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem.configType = (int)EConfigType.Socks;
result = result.Substring(Global.socksProtocol.Length);
//remark
int indexRemark = result.IndexOf("#");
if (indexRemark > 0)
{
try
{
vmessItem.remarks = WebUtility.UrlDecode(result.Substring(indexRemark + 1, result.Length - indexRemark - 1));
}
catch { }
result = result.Substring(0, indexRemark);
}
//part decode
int indexS = result.IndexOf("@");
if (indexS > 0)
{
}
else
{
result = Utils.Base64Decode(result);
}
string[] arr1 = result.Split('@');
if (arr1.Length != 2)
{
return null;
}
string[] arr21 = arr1[0].Split(':');
//string[] arr22 = arr1[1].Split(':');
int indexPort = arr1[1].LastIndexOf(":");
if (arr21.Length != 2 || indexPort < 0)
{
return null;
}
vmessItem.address = arr1[1].Substring(0, indexPort);
vmessItem.port = Utils.ToInt(arr1[1].Substring(indexPort + 1, arr1[1].Length - (indexPort + 1)));
vmessItem.security = arr21[0];
vmessItem.id = arr21[1];
}
else if (result.StartsWith(Global.trojanProtocol))
{
msg = UIRes.I18N("ConfigurationFormatIncorrect");
vmessItem.configType = (int)EConfigType.Trojan;
Uri uri = new Uri(result);
vmessItem.address = uri.IdnHost;
vmessItem.port = uri.Port;
vmessItem.id = uri.UserInfo;
var remarks = uri.Fragment.Replace("#", "");
if (Utils.IsNullOrEmpty(remarks))
{
vmessItem.remarks = "NONE";
}
else
{
vmessItem.remarks = WebUtility.UrlDecode(remarks);
}
}
else
{
msg = UIRes.I18N("NonvmessOrssProtocol");
return null;
}
}
catch
{
msg = UIRes.I18N("Incorrectconfiguration");
return null;
}
return vmessItem;
}
/// <summary>
/// 导出为客户端配置
/// </summary>
@ -1491,216 +1354,6 @@ namespace v2rayN.Handler
return GenerateServerConfig(config, fileName, out msg);
}
private static VmessItem ResolveVmess4Kitsunebi(string result)
{
VmessItem vmessItem = new VmessItem
{
configType = (int)EConfigType.Vmess
};
result = result.Substring(Global.vmessProtocol.Length);
int indexSplit = result.IndexOf("?");
if (indexSplit > 0)
{
result = result.Substring(0, indexSplit);
}
result = Utils.Base64Decode(result);
string[] arr1 = result.Split('@');
if (arr1.Length != 2)
{
return null;
}
string[] arr21 = arr1[0].Split(':');
string[] arr22 = arr1[1].Split(':');
if (arr21.Length != 2 || arr21.Length != 2)
{
return null;
}
vmessItem.address = arr22[0];
vmessItem.port = Utils.ToInt(arr22[1]);
vmessItem.security = arr21[0];
vmessItem.id = arr21[1];
vmessItem.network = Global.DefaultNetwork;
vmessItem.headerType = Global.None;
vmessItem.remarks = "Alien";
vmessItem.alterId = 0;
return vmessItem;
}
private static VmessItem ResolveSip002(string result)
{
Uri parsedUrl;
try
{
parsedUrl = new Uri(result);
}
catch (UriFormatException)
{
return null;
}
VmessItem server = new VmessItem
{
remarks = parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped),
address = parsedUrl.IdnHost,
port = parsedUrl.Port,
};
// parse base64 UserInfo
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.Unescaped);
string base64 = rawUserInfo.Replace('-', '+').Replace('_', '/'); // Web-safe base64 to normal base64
string userInfo;
try
{
userInfo = Encoding.UTF8.GetString(Convert.FromBase64String(
base64.PadRight(base64.Length + (4 - base64.Length % 4) % 4, '=')));
}
catch (FormatException)
{
return null;
}
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2);
if (userInfoParts.Length != 2)
{
return null;
}
server.security = userInfoParts[0];
server.id = userInfoParts[1];
NameValueCollection queryParameters = HttpUtility.ParseQueryString(parsedUrl.Query);
if (queryParameters["plugin"] != null)
{
return null;
}
return server;
}
private static readonly Regex UrlFinder = new Regex(@"ss://(?<base64>[A-Za-z0-9+-/=_]+)(?:#(?<tag>\S+))?", RegexOptions.IgnoreCase);
private static readonly Regex DetailsParser = new Regex(@"^((?<method>.+?):(?<password>.*)@(?<hostname>.+?):(?<port>\d+?))$", RegexOptions.IgnoreCase);
private static VmessItem ResolveSSLegacy(string result)
{
var match = UrlFinder.Match(result);
if (!match.Success)
return null;
VmessItem server = new VmessItem();
var base64 = match.Groups["base64"].Value.TrimEnd('/');
var tag = match.Groups["tag"].Value;
if (!tag.IsNullOrEmpty())
{
server.remarks = HttpUtility.UrlDecode(tag, Encoding.UTF8);
}
Match details;
try
{
details = DetailsParser.Match(Encoding.UTF8.GetString(Convert.FromBase64String(
base64.PadRight(base64.Length + (4 - base64.Length % 4) % 4, '='))));
}
catch (FormatException)
{
return null;
}
if (!details.Success)
return null;
server.security = details.Groups["method"].Value;
server.id = details.Groups["password"].Value;
server.address = details.Groups["hostname"].Value;
server.port = int.Parse(details.Groups["port"].Value);
return server;
}
private static readonly Regex StdVmessUserInfo = new Regex(
@"^(?<network>[a-z]+)(\+(?<streamSecurity>[a-z]+))?:(?<id>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})-(?<alterId>[0-9]+)$");
private static VmessItem ResolveStdVmess(string result)
{
VmessItem i = new VmessItem
{
configType = (int)EConfigType.Vmess,
security = "auto"
};
Uri u = new Uri(result);
i.address = u.IdnHost;
i.port = u.Port;
i.remarks = u.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
var q = HttpUtility.ParseQueryString(u.Query);
var m = StdVmessUserInfo.Match(u.UserInfo);
if (!m.Success) return null;
i.id = m.Groups["id"].Value;
if (!int.TryParse(m.Groups["alterId"].Value, out int aid))
{
return null;
}
i.alterId = aid;
if (m.Groups["streamSecurity"].Success)
{
i.streamSecurity = m.Groups["streamSecurity"].Value;
}
switch (i.streamSecurity)
{
case "tls":
// TODO tls config
break;
default:
if (!string.IsNullOrWhiteSpace(i.streamSecurity))
return null;
break;
}
i.network = m.Groups["network"].Value;
switch (i.network)
{
case "tcp":
string t1 = q["type"] ?? "none";
i.headerType = t1;
// TODO http option
break;
case "kcp":
i.headerType = q["type"] ?? "none";
// TODO kcp seed
break;
case "ws":
string p1 = q["path"] ?? "/";
string h1 = q["host"] ?? "";
i.requestHost = h1;
i.path = p1;
break;
case "http":
i.network = "h2";
string p2 = q["path"] ?? "/";
string h2 = q["host"] ?? "";
i.requestHost = h2;
i.path = p2;
break;
case "quic":
string s = q["security"] ?? "none";
string k = q["key"] ?? "";
string t3 = q["type"] ?? "none";
i.headerType = t3;
i.requestHost = s;
i.path = k;
break;
default:
return null;
}
return i;
}
#endregion
#region Gen speedtest config
@ -1742,7 +1395,7 @@ namespace v2rayN.Handler
//routing(config, ref v2rayConfig);
dns(configCopy, ref v2rayConfig);
v2rayConfig.inbounds.RemoveAt(0); // Remove "proxy" service for speedtest, avoiding port conflicts.
v2rayConfig.inbounds.Clear(); // Remove "proxy" service for speedtest, avoiding port conflicts.
int httpPort = configCopy.GetLocalPort("speedtest");
foreach (int index in selecteds)

View file

@ -22,17 +22,13 @@ namespace v2rayN.Handler
{
private static string v2rayConfigRes = Global.v2rayConfigFileName;
private List<string> lstV2ray;
private string coreUrl;
public event ProcessDelegate ProcessEvent;
//private int processId = 0;
private Process _process;
public V2rayHandler()
{
lstV2ray = new List<string>
{
"wv2ray",
"v2ray"
};
}
/// <summary>
@ -40,6 +36,24 @@ namespace v2rayN.Handler
/// </summary>
public void LoadV2ray(Config config)
{
if (config.coreType == ECoreType.v2fly_core)
{
lstV2ray = new List<string>
{
"wv2ray",
"v2ray"
};
coreUrl = Global.v2flyCoreUrl;
}
else
{
lstV2ray = new List<string>
{
"xray"
};
coreUrl = Global.xrayCoreUrl;
}
if (Global.reloadV2ray)
{
string fileName = Utils.GetPath(v2rayConfigRes);
@ -158,10 +172,11 @@ namespace v2rayN.Handler
}
}
private string V2rayFindexe() {
private string V2rayFindexe()
{
//查找v2ray文件是否存在
string fileName = string.Empty;
lstV2ray.Reverse();
//lstV2ray.Reverse();
foreach (string name in lstV2ray)
{
string vName = string.Format("{0}.exe", name);
@ -174,7 +189,7 @@ namespace v2rayN.Handler
}
if (Utils.IsNullOrEmpty(fileName))
{
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"https://github.com/v2fly/v2ray-core/releases");
string msg = string.Format(UIRes.I18N("NotFoundCore"), coreUrl);
ShowMsg(false, msg);
}
return fileName;

View file

@ -10,23 +10,20 @@ namespace v2rayN.HttpProxyHandler
{
noHttpProxy = 0,
GlobalHttp = 1,
GlobalPac = 2,
HttpOpenAndClear = 3,
PacOpenAndClear = 4,
HttpOpenOnly = 5,
PacOpenOnly = 6
HttpOpenAndClear = 2,
HttpOpenOnly = 3,
}
/// <summary>
/// 系统代理(http)总处理
/// 启动privoxy提供http协议
/// 设置IE系统代理或者PAC模式
/// 设置IE系统代理
/// </summary>
class HttpProxyHandle
{
private static bool Update(Config config, bool forceDisable)
{
ListenerType type = config.listenerType;
// ListenerType type = config.listenerType;
var type = ListenerType.noHttpProxy;
if (forceDisable)
{
type = ListenerType.noHttpProxy;
@ -43,47 +40,21 @@ namespace v2rayN.HttpProxyHandler
}
if (type == ListenerType.GlobalHttp)
{
//PACServerHandle.Stop();
//ProxySetting.SetProxy($"{Global.Loopback}:{port}", Global.IEProxyExceptions, 2);
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}");
}
else if (type == ListenerType.GlobalPac)
{
string pacUrl = GetPacUrl();
//ProxySetting.SetProxy(pacUrl, "", 4);
SysProxyHandle.SetIEProxy(true, false, pacUrl);
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
else if (type == ListenerType.HttpOpenAndClear)
{
//PACServerHandle.Stop();
SysProxyHandle.ResetIEProxy();
}
else if (type == ListenerType.PacOpenAndClear)
{
string pacUrl = GetPacUrl();
SysProxyHandle.ResetIEProxy();
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
else if (type == ListenerType.HttpOpenOnly)
{
//PACServerHandle.Stop();
//SysProxyHandle.ResetIEProxy();
}
else if (type == ListenerType.PacOpenOnly)
{
string pacUrl = GetPacUrl();
//SysProxyHandle.ResetIEProxy();
//PACServerHandle.Stop();
PACServerHandle.Init(config);
}
}
else
{
SysProxyHandle.ResetIEProxy();
//PACServerHandle.Stop();
}
}
catch (Exception ex)
@ -110,7 +81,6 @@ namespace v2rayN.HttpProxyHandler
Global.sysAgent = true;
Global.socksPort = localPort;
Global.httpPort = PrivoxyHandler.Instance.RunningPort;
Global.pacPort = config.GetLocalPort("pac");
}
}
}
@ -127,10 +97,10 @@ namespace v2rayN.HttpProxyHandler
{
try
{
if (config.listenerType != ListenerType.HttpOpenOnly && config.listenerType != ListenerType.PacOpenOnly)
{
Update(config, true);
}
//if (config.listenerType != ListenerType.HttpOpenOnly)
//{
// Update(config, true);
//}
PrivoxyHandler.Instance.Stop();
@ -151,11 +121,11 @@ namespace v2rayN.HttpProxyHandler
public static void RestartHttpAgent(Config config, bool forced)
{
bool isRestart = false;
if (config.listenerType == ListenerType.noHttpProxy)
{
// 关闭http proxy时直接返回
return;
}
//if (config.listenerType == ListenerType.noHttpProxy)
//{
// // 关闭http proxy时直接返回
// return;
//}
//强制重启或者socks端口变化
if (forced)
{
@ -177,10 +147,40 @@ namespace v2rayN.HttpProxyHandler
Update(config, false);
}
public static string GetPacUrl()
public static bool UpdateSysProxy(Config config, bool forceDisable)
{
string pacUrl = $"http://{Global.Loopback}:{Global.pacPort}/pac/?t={ DateTime.Now.ToString("HHmmss")}";
return pacUrl;
var type = config.sysProxyType;
if (forceDisable)
{
type = ESysProxyType.ForcedClear;
}
try
{
Global.httpPort = config.GetLocalPort(Global.InboundHttp);
int port = Global.httpPort;
if (port <= 0)
{
return false;
}
if (type == ESysProxyType.ForcedChange)
{
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}");
}
else if (type == ESysProxyType.ForcedClear)
{
SysProxyHandle.ResetIEProxy();
}
else if (type == ESysProxyType.Unchanged)
{
}
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
return true;
}
}
}

View file

@ -1,209 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.Tool;
using v2rayN.Base;
namespace v2rayN.HttpProxyHandler
{
/// <summary>
/// 提供PAC功能支持
/// </summary>
class PACServerHandle
{
private static int pacPort = 0;
private static HttpWebServer server;
private static HttpWebServerB serverB;
private static Config _config;
public static bool IsRunning
{
get
{
return (pacPort > 0);
}
}
public static void Init(Config config)
{
_config = config;
Global.pacPort = config.GetLocalPort("pac");
if (InitServer("*"))
{
pacPort = Global.pacPort;
}
//else if (InitServer(Global.Loopback))
//{
// pacPort = Global.pacPort;
//}
else if (InitServerB(Global.Loopback))
{
pacPort = Global.pacPort;
}
else
{
Utils.SaveLog("Webserver init failed ");
pacPort = 0;
}
}
private static bool InitServer(string address)
{
try
{
if (pacPort != Global.pacPort)
{
if (server != null)
{
server.Stop();
server = null;
}
if (server == null)
{
string prefixes = string.Format("http://{0}:{1}/pac/", address, Global.pacPort);
Utils.SaveLog("Webserver prefixes " + prefixes);
server = new HttpWebServer(SendResponse, prefixes);
server.Run();
}
}
Utils.SaveLog("Webserver at " + address);
}
catch (Exception ex)
{
Utils.SaveLog("Webserver InitServer " + ex.Message);
return false;
}
return true;
}
public static bool InitServerB(string address)
{
try
{
if (pacPort != Global.pacPort)
{
if (serverB != null)
{
serverB.Stop();
serverB = null;
}
if (serverB == null)
{
serverB = new HttpWebServerB(Global.pacPort, SendResponse);
}
}
Utils.SaveLog("WebserverB at " + address);
}
catch (Exception ex)
{
Utils.SaveLog("WebserverB InitServer " + ex.Message);
return false;
}
return true;
}
public static string SendResponse(string address)
{
try
{
string pac = GetPacList(address);
return pac;
}
catch (Exception ex)
{
Utils.SaveLog("Webserver SendResponse " + ex.Message);
return ex.Message;
}
}
public static void Stop()
{
try
{
if (server != null)
{
server.Stop();
server = null;
}
if (serverB != null)
{
serverB.Stop();
serverB = null;
}
}
catch (Exception ex)
{
Utils.SaveLog("Webserver Stop " + ex.Message);
}
//try
//{
// if (httpWebServer == null)
// {
// return;
// }
// foreach (var key in httpWebServer.Keys)
// {
// Utils.SaveLog("Webserver Stop " + key.ToString());
// ((HttpWebServer)httpWebServer[key]).Stop();
// }
// httpWebServer.Clear();
//}
//catch (Exception ex)
//{
// Utils.SaveLog("Webserver Stop " + ex.Message);
//}
}
private static string GetPacList(string address)
{
int port = Global.httpPort;
if (port <= 0)
{
return "No port";
}
try
{
List<string> lstProxy = new List<string>
{
string.Format("PROXY {0}:{1};", address, port)
};
string proxy = string.Join("", lstProxy.ToArray());
string strPacfile = Utils.GetPath(Global.pacFILE);
if (!File.Exists(strPacfile))
{
FileManager.UncompressFile(strPacfile, Resources.pac_txt);
}
string pac = File.ReadAllText(strPacfile, Encoding.UTF8);
pac = pac.Replace("__PROXY__", proxy);
if (_config.userPacRule.Count > 0)
{
string keyWords = "var rules = [";
if (pac.IndexOf(keyWords) >= 0)
{
string userPac = string.Join($"\",{Environment.NewLine}\"", _config.userPacRule.ToArray());
userPac = string.Format("\"{0}\",", userPac);
pac = pac.Replace(keyWords, keyWords + userPac);
}
}
return pac;
}
catch
{
}
return "No pac content";
}
}
}

View file

@ -74,7 +74,7 @@ namespace v2rayN.HttpProxyHandler
if (_process == null)
{
string privoxyConfig = Resources.privoxy_conf;
string privoxyConfig = "";//Resources.privoxy_conf;
RunningPort = config.GetLocalPort(Global.InboundHttp);
privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", localPort.ToString());
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", RunningPort.ToString());

View file

@ -0,0 +1,14 @@
namespace v2rayN.Mode
{
class ComboItem
{
public int ID
{
get; set;
}
public string Text
{
get; set;
}
}
}

View file

@ -60,46 +60,6 @@ namespace v2rayN.Mode
get; set;
}
/// <summary>
/// 域名解析策略
/// </summary>
public string domainStrategy
{
get; set;
}
/// <summary>
/// 路由模式
/// </summary>
public string routingMode
{
get; set;
}
/// <summary>
/// 用户自定义需代理的网址或ip
/// </summary>
public List<string> useragent
{
get; set;
}
/// <summary>
/// 用户自定义直连的网址或ip
/// </summary>
public List<string> userdirect
{
get; set;
}
/// <summary>
/// 用户自定义阻止的网址或ip
/// </summary>
public List<string> userblock
{
get; set;
}
/// <summary>
/// KcpItem
/// </summary>
@ -109,9 +69,9 @@ namespace v2rayN.Mode
}
/// <summary>
/// 监听状态
///
/// </summary>
public ListenerType listenerType
public ESysProxyType sysProxyType
{
get; set;
}
@ -130,13 +90,6 @@ namespace v2rayN.Mode
{
get; set;
}
/// <summary>
/// 自定义GFWList url
/// </summary>
public string urlGFWList
{
get; set;
}
/// <summary>
/// 允许来自局域网的连接
@ -201,8 +154,31 @@ namespace v2rayN.Mode
{
get; set;
}
/// <summary>
/// 域名解析策略
/// </summary>
public string domainStrategy
{
get; set;
}
public int routingIndex
{
get; set;
}
public List<RoutingItem> routings
{
get; set;
}
public bool enableRoutingAdvanced
{
get; set;
}
public List<string> userPacRule
public ECoreType coreType
{
get; set;
}
public bool ignoreGeoUpdateCore
{
get; set;
}
@ -317,10 +293,7 @@ namespace v2rayN.Mode
{
return GetLocalPort(Global.InboundSocks) + 1;
}
else if (protocol == "pac")
{
return GetLocalPort(Global.InboundSocks) + 2;
}
else if (protocol == "speedtest")
{
return GetLocalPort(Global.InboundSocks) + 103;
@ -373,6 +346,14 @@ namespace v2rayN.Mode
}
return vmess[index].flow.TrimEx();
}
public string sni()
{
if (index < 0)
{
return string.Empty;
}
return vmess[index].sni.TrimEx();
}
#endregion
}
@ -599,6 +580,13 @@ namespace v2rayN.Mode
{
get; set;
}
/// <summary>
/// tls sni
/// </summary>
public string sni
{
get; set;
}
}
[Serializable]

View file

@ -0,0 +1,9 @@

namespace v2rayN.Mode
{
public enum ECoreType
{
v2fly_core = 0,
Xray_core = 1
}
}

View file

@ -0,0 +1,10 @@

namespace v2rayN.Mode
{
public enum ESysProxyType
{
ForcedClear = 0,
ForcedChange = 1,
Unchanged = 2
}
}

View file

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace v2rayN.Mode
{
[Serializable]
public class RoutingItem
{
public string remarks
{
get; set;
}
public string url
{
get; set;
}
public List<RulesItem> rules
{
get; set;
}
public bool enabled { get; set; } = true;
public bool locked
{
get; set;
}
}
}

View file

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace v2rayN.Mode
{
[Serializable]
public class RulesItem
{
public string type { get; set; }
public string port { get; set; }
public List<string> inboundTag { get; set; }
public string outboundTag { get; set; }
public List<string> ip { get; set; }
public List<string> domain { get; set; }
public List<string> protocol { get; set; }
}
}

View file

@ -35,7 +35,7 @@ namespace v2rayN.Mode
/// <summary>
/// DNS 配置
/// </summary>
public Dns dns { get; set; }
public object dns { get; set; }
/// <summary>
/// 路由配置
/// </summary>
@ -57,8 +57,8 @@ namespace v2rayN.Mode
public class SystemPolicy
{
public bool statsInboundUplink;
public bool statsInboundDownlink;
public bool statsOutboundUplink;
public bool statsOutboundDownlink;
}
public class Log
@ -139,6 +139,8 @@ namespace v2rayN.Mode
/// </summary>
public string decryption { get; set; }
public bool allowTransparent { get; set; }
}
public class UsersItem
@ -321,34 +323,6 @@ namespace v2rayN.Mode
public List<string> servers { get; set; }
}
public class RulesItem
{
/// <summary>
///
/// </summary>
public string type { get; set; }
/// <summary>
///
/// </summary>
public string port { get; set; }
public List<string> inboundTag { get; set; }
/// <summary>
///
/// </summary>
public string outboundTag { get; set; }
/// <summary>
///
/// </summary>
public List<string> ip { get; set; }
/// <summary>
///
/// </summary>
public List<string> domain { get; set; }
}
public class Routing
{
/// <summary>
@ -403,6 +377,10 @@ namespace v2rayN.Mode
/// VLESS xtls
/// </summary>
public TlsSettings xtlsSettings { get; set; }
/// <summary>
/// grpc
/// </summary>
public GrpcSettings grpcSettings { get; set; }
}
@ -421,10 +399,6 @@ namespace v2rayN.Mode
public class TcpSettings
{
/// <summary>
/// 是否重用 TCP 连接
/// </summary>
public bool connectionReuse { get; set; }
/// <summary>
/// 数据包头部伪装设置
/// </summary>
@ -489,11 +463,6 @@ namespace v2rayN.Mode
public class WsSettings
{
/// <summary>
///
/// </summary>
public bool connectionReuse { get; set; }
/// <summary>
///
/// </summary>
@ -543,4 +512,12 @@ namespace v2rayN.Mode
public Header header { get; set; }
}
public class GrpcSettings
{
/// <summary>
///
/// </summary>
public string serviceName { get; set; }
}
}

View file

@ -49,5 +49,9 @@ namespace v2rayN.Mode
/// 底层传输安全
/// </summary>
public string tls { get; set; } = string.Empty;
/// <summary>
/// SNI
/// </summary>
public string sni { get; set; } = string.Empty;
}
}

View file

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

View file

@ -19,7 +19,7 @@ namespace v2rayN.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@ -70,16 +70,6 @@ namespace v2rayN.Properties {
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] abp_js {
get {
object obj = ResourceManager.GetObject("abp_js", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
@ -130,33 +120,6 @@ namespace v2rayN.Properties {
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] pac_txt {
get {
object obj = ResourceManager.GetObject("pac_txt", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找类似 listen-address __PRIVOXY_BIND_IP__:__PRIVOXY_BIND_PORT__
///toggle 0
///logfile v2ray_privoxy.log
///show-on-task-bar 0
///activity-animation 0
///forward-socks5 / 127.0.0.1:__SOCKS_PORT__ .
///max-client-connections 2048
///hide-console
/// 的本地化字符串。
/// </summary>
internal static string privoxy_conf {
get {
return ResourceManager.GetString("privoxy_conf", resourceCulture);
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>

View file

@ -151,21 +151,12 @@
<data name="sysproxy64_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\sysproxy64.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="privoxy_conf" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\privoxy_conf.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</value>
</data>
<data name="minimize" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pac_txt" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pac.txt.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">
<value>..\resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="abp_js" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\abp.js.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="share" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\share.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -1,8 +0,0 @@
listen-address __PRIVOXY_BIND_IP__:__PRIVOXY_BIND_PORT__
toggle 0
logfile v2ray_privoxy.log
show-on-task-bar 0
activity-animation 0
forward-socks5 / 127.0.0.1:__SOCKS_PORT__ .
max-client-connections 2048
hide-console

View file

@ -19,7 +19,7 @@ namespace v2rayN.Resx {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class ResUI {
@ -312,6 +312,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Count 的本地化字符串。
/// </summary>
internal static string LvCount {
get {
return ResourceManager.GetString("LvCount", resourceCulture);
}
}
/// <summary>
/// 查找类似 Security 的本地化字符串。
/// </summary>
@ -330,6 +339,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 remarks 的本地化字符串。
/// </summary>
internal static string LvRemarks {
get {
return ResourceManager.GetString("LvRemarks", resourceCulture);
}
}
/// <summary>
/// 查找类似 Type 的本地化字符串。
/// </summary>
@ -402,6 +420,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Url 的本地化字符串。
/// </summary>
internal static string LvUrl {
get {
return ResourceManager.GetString("LvUrl", resourceCulture);
}
}
/// <summary>
/// 查找类似 MediumFresh 的本地化字符串。
/// </summary>
@ -447,6 +474,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Please fill in the address (Url) 的本地化字符串。
/// </summary>
internal static string MsgNeedUrl {
get {
return ResourceManager.GetString("MsgNeedUrl", resourceCulture);
}
}
/// <summary>
/// 查找类似 No valid subscriptions set 的本地化字符串。
/// </summary>
@ -627,6 +663,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Operation success 的本地化字符串。
/// </summary>
internal static string OperationSuccess {
get {
return ResourceManager.GetString("OperationSuccess", resourceCulture);
}
}
/// <summary>
/// 查找类似 Please Fill Remarks 的本地化字符串。
/// </summary>
@ -654,6 +699,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Please select rules 的本地化字符串。
/// </summary>
internal static string PleaseSelectRules {
get {
return ResourceManager.GetString("PleaseSelectRules", resourceCulture);
}
}
/// <summary>
/// 查找类似 Please select the server first 的本地化字符串。
/// </summary>
@ -681,6 +735,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Are you sure to remove the rules? 的本地化字符串。
/// </summary>
internal static string RemoveRules {
get {
return ResourceManager.GetString("RemoveRules", resourceCulture);
}
}
/// <summary>
/// 查找类似 Are you sure to remove the server? 的本地化字符串。
/// </summary>
@ -690,6 +753,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 {0},One of the required. 的本地化字符串。
/// </summary>
internal static string RoutingRuleDetailRequiredTips {
get {
return ResourceManager.GetString("RoutingRuleDetailRequiredTips", resourceCulture);
}
}
/// <summary>
/// 查找类似 The client configuration file is saved at: {0} 的本地化字符串。
/// </summary>

View file

@ -238,7 +238,7 @@
<value>Clear original subscription content</value>
</data>
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
<value>Download V2ray successfully</value>
<value>Download Core successfully</value>
</data>
<data name="MsgFailedImportSubscription" xml:space="preserve">
<value>Failed to import subscription content</value>
@ -283,10 +283,10 @@
<value>Update subscription starts</value>
</data>
<data name="MsgUpdateV2rayCoreSuccessfully" xml:space="preserve">
<value>Update V2rayCore successfully</value>
<value>Update Core successfully</value>
</data>
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
<value>Update V2rayCore successfully! Restarting service...</value>
<value>Update Core successfully! Restarting service...</value>
</data>
<data name="NeedHttpGlobalProxy" xml:space="preserve">
<value> This feature relies on the Http global proxy, please set it correctly first.</value>
@ -298,7 +298,7 @@
<value> non-Vmess service, this feature is invalid</value>
</data>
<data name="NotFoundCore" xml:space="preserve">
<value>V2ray-core not found, please download: {0}</value>
<value>Core not found, please download: {0}</value>
</data>
<data name="NoValidQRcodeFound" xml:space="preserve">
<value>Scan completed, no valid QR code found</value>
@ -361,4 +361,28 @@
<data name="TestMeOutput" xml:space="preserve">
<value>The ping of current service: {0}</value>
</data>
<data name="OperationSuccess" xml:space="preserve">
<value>Operation success</value>
</data>
<data name="PleaseSelectRules" xml:space="preserve">
<value>Please select rules</value>
</data>
<data name="RemoveRules" xml:space="preserve">
<value>Are you sure to remove the rules?</value>
</data>
<data name="RoutingRuleDetailRequiredTips" xml:space="preserve">
<value>{0},One of the required.</value>
</data>
<data name="LvRemarks" xml:space="preserve">
<value>remarks</value>
</data>
<data name="LvUrl" xml:space="preserve">
<value>Url</value>
</data>
<data name="LvCount" xml:space="preserve">
<value>Count</value>
</data>
<data name="MsgNeedUrl" xml:space="preserve">
<value>Please fill in the address (Url)</value>
</data>
</root>

View file

@ -238,7 +238,7 @@
<value>清除原订阅内容</value>
</data>
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
<value>下载V2ray成功</value>
<value>下载Core成功</value>
</data>
<data name="MsgFailedImportSubscription" xml:space="preserve">
<value>导入订阅内容失败</value>
@ -283,10 +283,10 @@
<value>更新订阅开始</value>
</data>
<data name="MsgUpdateV2rayCoreSuccessfully" xml:space="preserve">
<value>更新V2rayCore成功</value>
<value>更新Core成功</value>
</data>
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
<value>更新V2rayCore成功正在重启服务...</value>
<value>更新Core成功正在重启服务...</value>
</data>
<data name="NeedHttpGlobalProxy" xml:space="preserve">
<value>此功能依赖Http全局代理,请先设置正确。</value>
@ -298,7 +298,7 @@
<value>非Vmess服务此功能无效</value>
</data>
<data name="NotFoundCore" xml:space="preserve">
<value>找不到 v2ray-core下载地址: {0}</value>
<value>找不到Core下载地址: {0}</value>
</data>
<data name="NoValidQRcodeFound" xml:space="preserve">
<value>扫描完成,未发现有效二维码</value>
@ -361,4 +361,28 @@
<data name="TestMeOutput" xml:space="preserve">
<value>当前服务的真连接延迟: {0}</value>
</data>
<data name="OperationSuccess" xml:space="preserve">
<value>操作成功</value>
</data>
<data name="PleaseSelectRules" xml:space="preserve">
<value>请先选择规则</value>
</data>
<data name="RemoveRules" xml:space="preserve">
<value>是否确定移除规则?</value>
</data>
<data name="RoutingRuleDetailRequiredTips" xml:space="preserve">
<value>{0},必填其中一项.</value>
</data>
<data name="LvRemarks" xml:space="preserve">
<value>别名</value>
</data>
<data name="LvUrl" xml:space="preserve">
<value>地址(Url)</value>
</data>
<data name="LvCount" xml:space="preserve">
<value>数量</value>
</data>
<data name="MsgNeedUrl" xml:space="preserve">
<value>请填写地址(Url)</value>
</data>
</root>

Binary file not shown.

View file

@ -1,5 +0,0 @@
var proxy = "__PROXY__";
function FindProxyForURL(url, host) {
return proxy;
}

View file

@ -1,17 +1,11 @@
{
"log": {
"access": "",
"error": "",
"loglevel": "error"
},
"log": {
"access": "Vaccess.log",
"error": "Verror.log",
"loglevel": "warning"
},
"inbounds": [
{
"tag": "proxy",
"inbounds": [{
"tag": "tag1",
"port": 10808,
"protocol": "socks",
"listen": "127.0.0.1",
@ -26,6 +20,22 @@
"tls"
]
}
},
{
"tag": "tag2",
"port": 10809,
"protocol": "socks",
"listen": "127.0.0.1",
"settings": {
"allowTransparent": false
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [{

View file

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

View file

@ -1,132 +0,0 @@
domain:12306.com,
domain:51ym.me,
domain:52pojie.cn,
domain:8686c.com,
domain:abercrombie.com,
domain:adobesc.com,
domain:air-matters.com,
domain:air-matters.io,
domain:airtable.com,
domain:akadns.net,
domain:apache.org,
domain:api.crisp.chat,
domain:api.termius.com,
domain:appshike.com,
domain:appstore.com,
domain:aweme.snssdk.com,
domain:bababian.com,
domain:battle.net,
domain:beatsbydre.com,
domain:bet365.com,
domain:bilibili.cn,
domain:ccgslb.com,
domain:ccgslb.net,
domain:chunbo.com,
domain:chunboimg.com,
domain:clashroyaleapp.com,
domain:cloudsigma.com,
domain:cloudxns.net,
domain:cmfu.com,
domain:culturedcode.com,
domain:dct-cloud.com,
domain:didialift.com,
domain:douyutv.com,
domain:duokan.com,
domain:dytt8.net,
domain:easou.com,
domain:ecitic.net,
domain:eclipse.org,
domain:eudic.net,
domain:ewqcxz.com,
domain:fir.im,
domain:frdic.com,
domain:fresh-ideas.cc,
domain:godic.net,
domain:goodread.com,
domain:haibian.com,
domain:hdslb.net,
domain:hollisterco.com,
domain:hongxiu.com,
domain:hxcdn.net,
domain:images.unsplash.com,
domain:img4me.com,
domain:ipify.org,
domain:ixdzs.com,
domain:jd.hk,
domain:jianshuapi.com,
domain:jomodns.com,
domain:jsboxbbs.com,
domain:knewone.com,
domain:kuaidi100.com,
domain:lemicp.com,
domain:letvcloud.com,
domain:lizhi.io,
domain:localizecdn.com,
domain:lucifr.com,
domain:luoo.net,
domain:mai.tn,
domain:maven.org,
domain:miwifi.com,
domain:moji.com,
domain:moke.com,
domain:mtalk.google.com,
domain:mxhichina.com,
domain:myqcloud.com,
domain:myunlu.com,
domain:netease.com,
domain:nfoservers.com,
domain:nssurge.com,
domain:nuomi.com,
domain:ourdvs.com,
domain:overcast.fm,
domain:paypal.com,
domain:paypalobjects.com,
domain:pgyer.com,
domain:qdaily.com,
domain:qdmm.com,
domain:qin.io,
domain:qingmang.me,
domain:qingmang.mobi,
domain:qqurl.com,
domain:rarbg.to,
domain:rrmj.tv,
domain:ruguoapp.com,
domain:sm.ms,
domain:snwx.com,
domain:soku.com,
domain:startssl.com,
domain:store.steampowered.com,
domain:symcd.com,
domain:teamviewer.com,
domain:tmzvps.com,
domain:trello.com,
domain:trellocdn.com,
domain:ttmeiju.com,
domain:udache.com,
domain:uxengine.net,
domain:weather.bjango.com,
domain:weather.com,
domain:webqxs.com,
domain:weico.cc,
domain:wenku8.net,
domain:werewolf.53site.com,
domain:windowsupdate.com,
domain:wkcdn.com,
domain:workflowy.com,
domain:xdrig.com,
domain:xiaojukeji.com,
domain:xiaomi.net,
domain:xiaomicp.com,
domain:ximalaya.com,
domain:xitek.com,
domain:xmcdn.com,
domain:xslb.net,
domain:xteko.com,
domain:yach.me,
domain:yixia.com,
domain:yunjiasu-cdn.net,
domain:zealer.com,
domain:zgslb.net,
domain:zimuzu.tv,
domain:zmz002.com,
domain:samsungdm.com,

View file

@ -0,0 +1,6 @@
[
{
"port": "0-65535",
"outboundTag": "proxy"
}
]

View file

@ -0,0 +1,21 @@
[
{
"domain": [
"geosite:google"
],
"outboundTag": "proxy"
},
{
"outboundTag": "direct",
"domain": [
"domain:example-example.com",
"domain:example-example2.com"
]
},
{
"outboundTag": "block",
"domain": [
"geosite:category-ads-all"
]
}
]

View file

@ -1,33 +0,0 @@
geosite:google,
geosite:github,
geosite:netflix,
geosite:steam,
geosite:telegram,
geosite:tumblr,
geosite:speedtest,
geosite:bbc,
domain:gvt1.com,
domain:textnow.com,
domain:twitch.tv,
domain:wikileaks.org,
domain:naver.com,
91.108.4.0/22,
91.108.8.0/22,
91.108.12.0/22,
91.108.20.0/22,
91.108.36.0/23,
91.108.38.0/23,
91.108.56.0/22,
149.154.160.0/20,
149.154.164.0/22,
149.154.172.0/22,
74.125.0.0/16,
173.194.0.0/16,
172.217.0.0/16,
216.58.200.0/24,
216.58.220.0/24,
91.108.56.116,
91.108.56.0/24,
109.239.140.0/24,
149.154.167.0/24,
149.154.175.0/24,

View file

@ -0,0 +1,28 @@
[{
"remarks": "block",
"outboundTag": "block",
"domain": [
"geosite:category-ads-all"
]
},
{
"remarks": "direct",
"outboundTag": "direct",
"domain": [
"geosite:cn"
]
},
{
"remarks": "direct",
"outboundTag": "direct",
"ip": [
"geoip:private",
"geoip:cn"
]
},
{
"remarks": "proxy",
"port": "0-65535",
"outboundTag": "proxy"
}
]

View file

@ -0,0 +1,32 @@
[
{
"outboundTag": "direct",
"domain": [
"domain:example-example.com",
"domain:example-example2.com"
]
},
{
"outboundTag": "block",
"domain": [
"geosite:category-ads-all"
]
},
{
"outboundTag": "direct",
"domain": [
"geosite:cn"
]
},
{
"outboundTag": "direct",
"ip": [
"geoip:private",
"geoip:cn"
]
},
{
"port": "0-65535",
"outboundTag": "proxy"
}
]

View file

@ -1,156 +0,0 @@
using System;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
namespace v2rayN
{
class CDateTime
{
/// <summary>
/// 设置本地系统时间
/// </summary>
public static void SetLocalTime()
{
using (WebClient wc = new WebClient())
{
string url = "";
string result = string.Empty;
try
{
wc.Encoding = Encoding.UTF8;
wc.DownloadStringCompleted += wc_DownloadStringCompleted;
wc.DownloadStringAsync(new Uri(url));
}
catch
{
}
}
}
static void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
try
{
string result = e.Result;
if (Utils.IsNullOrEmpty(result))
{
return;
}
EWebTime webTime = Utils.FromJson<EWebTime>(result);
if (webTime != null
&& webTime.result != null
&& webTime.result.stime != null
&& !Utils.IsNullOrEmpty(webTime.result.stime))
{
DateTime dtWeb = GetTimeFromLinux(webTime.result.stime);
SYSTEMTIME st = new SYSTEMTIME();
st.FromDateTime(dtWeb);
//调用Win32 API设置系统时间
Win32API.SetLocalTime(ref st);
}
}
catch
{
}
}
/// <summary>
/// 时间戳转为C#格式时间
/// </summary>
/// <param name="timeStamp"></param>
/// <returns></returns>
private static DateTime GetTimeFromLinux(string timeStamp)
{
DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
long lTime = long.Parse(timeStamp + "0000000");
TimeSpan toNow = new TimeSpan(lTime); return dtStart.Add(toNow);
}
}
/// <summary>
///
/// </summary>
public struct SYSTEMTIME
{
public ushort wYear;
public ushort wMonth;
public ushort wDayOfWeek;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
public ushort wMilliseconds;
/// <summary>
/// 从System.DateTime转换。
/// </summary>
/// <param name="time">System.DateTime类型的时间。</param>
public void FromDateTime(DateTime time)
{
wYear = (ushort)time.Year;
wMonth = (ushort)time.Month;
wDayOfWeek = (ushort)time.DayOfWeek;
wDay = (ushort)time.Day;
wHour = (ushort)time.Hour;
wMinute = (ushort)time.Minute;
wSecond = (ushort)time.Second;
wMilliseconds = (ushort)time.Millisecond;
}
/// <summary>
/// 转换为System.DateTime类型。
/// </summary>
/// <returns></returns>
public DateTime ToDateTime()
{
return new DateTime(wYear, wMonth, wDay, wHour, wMinute, wSecond, wMilliseconds);
}
/// <summary>
/// 静态方法。转换为System.DateTime类型。
/// </summary>
/// <param name="time">SYSTEMTIME类型的时间。</param>
/// <returns></returns>
public static DateTime ToDateTime(SYSTEMTIME time)
{
return time.ToDateTime();
}
}
public class Win32API
{
[DllImport("Kernel32.dll")]
public static extern bool SetLocalTime(ref SYSTEMTIME Time);
[DllImport("Kernel32.dll")]
public static extern void GetLocalTime(ref SYSTEMTIME Time);
}
public class WTResult
{
/// <summary>
///
/// </summary>
public string stime { get; set; }
}
public class EWebTime
{
/// <summary>
///
/// </summary>
public WTResult result { get; set; }
/// <summary>
///
/// </summary>
public int error_code { get; set; }
/// <summary>
///
/// </summary>
public string reason { get; set; }
}
}

View file

@ -68,7 +68,7 @@ namespace v2rayN.Tool
throw ex;
}
}
public static bool ZipExtractToFile(string fileName)
public static bool ZipExtractToFile(string fileName, string ignoredName)
{
try
{
@ -82,6 +82,10 @@ namespace v2rayN.Tool
}
try
{
if (!Utils.IsNullOrEmpty(ignoredName) && entry.Name.Contains(ignoredName))
{
continue;
}
entry.ExtractToFile(Utils.GetPath(entry.Name), true);
}
catch (IOException ex)

View file

@ -19,13 +19,14 @@ using ZXing.Common;
using ZXing.QrCode;
using System.Security.Principal;
using v2rayN.Base;
using Newtonsoft.Json.Linq;
using System.Web;
namespace v2rayN
{
class Utils
{
#region Json操作
/// <summary>
@ -119,16 +120,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);
}
@ -140,6 +147,19 @@ namespace v2rayN
}
return result;
}
public static JObject ParseJson(string strJson)
{
try
{
JObject obj = JObject.Parse(strJson);
return obj;
}
catch
{
return null;
}
}
#endregion
#region
@ -350,6 +370,14 @@ namespace v2rayN
result = list;
}
public static string UrlEncode(string url)
{
return HttpUtility.UrlEncode(url);
}
public static string UrlDecode(string url)
{
return HttpUtility.UrlDecode(url);
}
#endregion
@ -459,6 +487,24 @@ namespace v2rayN
return Regex.IsMatch(input, pattern, RegexOptions.IgnoreCase);
}
public static bool IsIpv6(string ip)
{
IPAddress address;
if (IPAddress.TryParse(ip, out address))
{
switch (address.AddressFamily)
{
case AddressFamily.InterNetwork:
return false;
case AddressFamily.InterNetworkV6:
return true;
default:
return false;
}
}
return false;
}
#endregion
#region
@ -782,6 +828,10 @@ namespace v2rayN
}
}
public static void AddSubItem(ListViewItem i, string name, string text)
{
i.SubItems.Add(new ListViewItem.ListViewSubItem() { Name = name, Text = text });
}
#endregion
#region TempPath

Some files were not shown because too many files have changed in this diff Show more