添加代理转发设置

This commit is contained in:
Mlen 2020-03-26 20:15:24 +08:00
parent 07bdcb5491
commit 5883e90bee
8 changed files with 3441 additions and 2275 deletions

File diff suppressed because it is too large Load diff

View file

@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using v2rayN.Handler; using v2rayN.Handler;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.HttpProxyHandler; using v2rayN.HttpProxyHandler;
namespace v2rayN.Forms namespace v2rayN.Forms
{ {
public partial class OptionSettingForm : BaseForm public partial class OptionSettingForm : BaseForm
@ -36,6 +36,23 @@ namespace v2rayN.Forms
chklogEnabled.Checked = config.logEnabled; chklogEnabled.Checked = config.logEnabled;
cmbloglevel.Text = config.loglevel; cmbloglevel.Text = config.loglevel;
//代理转发
chktransitEnabled.Checked = config.transitEnabled;
ConfigHandler.LoadConfig(ref config);
if (config.vmess == null)
{
TransitList.Items.Add(null);
}
else
{
for (int i = 0; i < config.vmess.Count; i++)
{
TransitList.Items.Add(i.ToString() + ' ' + config.vmess[i].remarks);
}
}
TransitList.Text = config.transitSetting.ToString() + ' ' + config.vmess[config.transitSetting].remarks;
//Mux //Mux
chkmuxEnabled.Checked = config.muxEnabled; chkmuxEnabled.Checked = config.muxEnabled;
@ -196,6 +213,11 @@ namespace v2rayN.Forms
bool logEnabled = chklogEnabled.Checked; bool logEnabled = chklogEnabled.Checked;
string loglevel = cmbloglevel.Text.TrimEx(); string loglevel = cmbloglevel.Text.TrimEx();
//代理转发
//bool logEnabled = chklogEnabled.Checked;
System.Text.RegularExpressions.Match matchNumber = System.Text.RegularExpressions.Regex.Match(TransitList.Text, "(^[0-9]+)");
int transitSetting = Convert.ToInt32(matchNumber.Value);
//Mux //Mux
bool muxEnabled = chkmuxEnabled.Checked; bool muxEnabled = chkmuxEnabled.Checked;
@ -257,6 +279,10 @@ namespace v2rayN.Forms
config.logEnabled = logEnabled; config.logEnabled = logEnabled;
config.loglevel = loglevel; config.loglevel = loglevel;
//代理转发
config.transitEnabled = chktransitEnabled.Checked;
config.transitSetting = transitSetting;
//Mux //Mux
config.muxEnabled = muxEnabled; config.muxEnabled = muxEnabled;

File diff suppressed because it is too large Load diff

View file

@ -1,369 +1,372 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <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> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : 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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata"> <xsd:element name="metadata">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" /> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
<xsd:complexType> <xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <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:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <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="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" /> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" /> <xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:choice> </xsd:choice>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:schema> </xsd:schema>
<resheader name="resmimetype"> <resheader name="resmimetype">
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="$this.Text" xml:space="preserve"> <data name="$this.Text" xml:space="preserve">
<value>参数设置</value> <value>参数设置</value>
</data> </data>
<data name="btnClose.Text" xml:space="preserve"> <data name="btnClose.Text" xml:space="preserve">
<value>取消(&amp;C)</value> <value>取消(&amp;C)</value>
</data> </data>
<data name="btnOK.Text" xml:space="preserve"> <data name="btnOK.Text" xml:space="preserve">
<value>确定(&amp;O)</value> <value>确定(&amp;O)</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <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"> <data name="btnSetDefRountingRule.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing"> <data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
<value>351, 14</value> <value>351, 14</value>
</data> </data>
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing"> <data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
<value>201, 23</value> <value>201, 23</value>
</data> </data>
<data name="btnSetDefRountingRule.Text" xml:space="preserve"> <data name="btnSetDefRountingRule.Text" xml:space="preserve">
<value>一键设置默认自定义路由规则</value> <value>一键设置默认自定义路由规则</value>
</data> </data>
<data name="chkAllowIn2.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkAllowIn2.Size" type="System.Drawing.Size, System.Drawing">
<value>102, 16</value> <value>102, 16</value>
</data> </data>
<data name="chkAllowIn2.Text" xml:space="preserve"> <data name="chkAllowIn2.Text" xml:space="preserve">
<value>本地监听端口2</value> <value>本地监听端口2</value>
</data> </data>
<data name="chkAllowLANConn.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkAllowLANConn.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 16</value> <value>144, 16</value>
</data> </data>
<data name="chkAllowLANConn.Text" xml:space="preserve"> <data name="chkAllowLANConn.Text" xml:space="preserve">
<value>允许来自局域网的连接</value> <value>允许来自局域网的连接</value>
</data> </data>
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 16</value> <value>180, 16</value>
</data> </data>
<data name="chkAutoRun.Text" xml:space="preserve"> <data name="chkAutoRun.Text" xml:space="preserve">
<value>开机自动启动(可能会不成功)</value> <value>开机自动启动(可能会不成功)</value>
</data> </data>
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>384, 16</value> <value>384, 16</value>
</data> </data>
<data name="chkEnableStatistics.Text" xml:space="preserve"> <data name="chkEnableStatistics.Text" xml:space="preserve">
<value>启用统计实时网速显示和使用流量显示需要重启v2rayN客户端</value> <value>启用统计实时网速显示和使用流量显示需要重启v2rayN客户端</value>
</data> </data>
<data name="chkKeepOlderDedupl.Text" xml:space="preserve"> <data name="chkKeepOlderDedupl.Text" xml:space="preserve">
<value>去重时保留序号较小的项</value> <value>去重时保留序号较小的项</value>
</data> </data>
<data name="chklogEnabled.Size" type="System.Drawing.Size, System.Drawing"> <data name="chklogEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 16</value> <value>156, 16</value>
</data> </data>
<data name="chklogEnabled.Text" xml:space="preserve"> <data name="chklogEnabled.Text" xml:space="preserve">
<value>记录本地日志(默认关闭)</value> <value>记录本地日志(默认关闭)</value>
</data> </data>
<data name="chkmuxEnabled.Text" xml:space="preserve"> <data name="chkmuxEnabled.Text" xml:space="preserve">
<value>开启Mux多路复用(默认开启)</value> <value>开启Mux多路复用(默认开启)</value>
</data> </data>
<data name="chksniffingEnabled.Size" type="System.Drawing.Size, System.Drawing"> <data name="chksniffingEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 16</value> <value>96, 16</value>
</data> </data>
<data name="chksniffingEnabled.Text" xml:space="preserve"> <data name="chksniffingEnabled.Text" xml:space="preserve">
<value>开启流量探测</value> <value>开启流量探测</value>
</data> </data>
<data name="chksniffingEnabled2.Size" type="System.Drawing.Size, System.Drawing"> <data name="chksniffingEnabled2.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 16</value> <value>96, 16</value>
</data> </data>
<data name="chksniffingEnabled2.Text" xml:space="preserve"> <data name="chksniffingEnabled2.Text" xml:space="preserve">
<value>开启流量探测</value> <value>开启流量探测</value>
</data> </data>
<data name="chkudpEnabled.Size" type="System.Drawing.Size, System.Drawing"> <data name="chktransitEnabled.Text" xml:space="preserve">
<value>66, 16</value> <value>代理转发</value>
</data> </data>
<data name="chkudpEnabled.Text" xml:space="preserve"> <data name="chkudpEnabled.Size" type="System.Drawing.Size, System.Drawing">
<value>开启UDP</value> <value>66, 16</value>
</data> </data>
<data name="chkudpEnabled2.Size" type="System.Drawing.Size, System.Drawing"> <data name="chkudpEnabled.Text" xml:space="preserve">
<value>66, 16</value> <value>开启UDP</value>
</data> </data>
<data name="chkudpEnabled2.Text" xml:space="preserve"> <data name="chkudpEnabled2.Size" type="System.Drawing.Size, System.Drawing">
<value>开启UDP</value> <value>66, 16</value>
</data> </data>
<data name="cmblistenerType.Items" xml:space="preserve"> <data name="chkudpEnabled2.Text" xml:space="preserve">
<value>关闭Http代理</value> <value>开启UDP</value>
</data> </data>
<data name="cmblistenerType.Items1" xml:space="preserve"> <data name="cmblistenerType.Items" xml:space="preserve">
<value>开启Http代理,并自动配置系统代理(全局模式)</value> <value>关闭Http代理</value>
</data> </data>
<data name="cmblistenerType.Items2" xml:space="preserve"> <data name="cmblistenerType.Items1" xml:space="preserve">
<value>开启PAC,并自动配置系统代理(PAC模式)</value> <value>开启Http代理,并自动配置系统代理(全局模式)</value>
</data> </data>
<data name="cmblistenerType.Items3" xml:space="preserve"> <data name="cmblistenerType.Items2" xml:space="preserve">
<value>仅开启Http代理,并清除系统代理</value> <value>开启PAC,并自动配置系统代理(PAC模式)</value>
</data> </data>
<data name="cmblistenerType.Items4" xml:space="preserve"> <data name="cmblistenerType.Items3" xml:space="preserve">
<value>仅开启PAC,并清除系统代理</value> <value>仅开启Http代理,并清除系统代理</value>
</data> </data>
<data name="cmblistenerType.Items5" xml:space="preserve"> <data name="cmblistenerType.Items4" xml:space="preserve">
<value>仅开启Http代理,不改变系统代理</value> <value>仅开启PAC,并清除系统代理</value>
</data> </data>
<data name="cmblistenerType.Items6" xml:space="preserve"> <data name="cmblistenerType.Items5" xml:space="preserve">
<value>仅开启PAC,不改变系统代理</value> <value>仅开启Http代理,不改变系统代理</value>
</data> </data>
<data name="cmbroutingMode.Items" xml:space="preserve"> <data name="cmblistenerType.Items6" xml:space="preserve">
<value>全局</value> <value>仅开启PAC,不改变系统代理</value>
</data> </data>
<data name="cmbroutingMode.Items1" xml:space="preserve"> <data name="cmbroutingMode.Items" xml:space="preserve">
<value>绕过局域网地址</value> <value>全局</value>
</data> </data>
<data name="cmbroutingMode.Items2" xml:space="preserve"> <data name="cmbroutingMode.Items1" xml:space="preserve">
<value>绕过大陆地址</value> <value>绕过局域网地址</value>
</data> </data>
<data name="cmbroutingMode.Items3" xml:space="preserve"> <data name="cmbroutingMode.Items2" xml:space="preserve">
<value>绕过局域网及大陆地址</value> <value>绕过大陆地址</value>
</data> </data>
<data name="cmbroutingMode.Location" type="System.Drawing.Point, System.Drawing"> <data name="cmbroutingMode.Items3" xml:space="preserve">
<value>19, 26</value> <value>绕过局域网及大陆地址</value>
</data> </data>
<data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing"> <data name="cmbroutingMode.Location" type="System.Drawing.Point, System.Drawing">
<value>244, 20</value> <value>19, 26</value>
</data> </data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing"> <data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 12</value> <value>244, 20</value>
</data> </data>
<data name="label1.Text" xml:space="preserve"> <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>协议</value> <value>29, 12</value>
</data> </data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing"> <data name="label1.Text" xml:space="preserve">
<value>227, 12</value> <value>协议</value>
</data> </data>
<data name="label13.Text" xml:space="preserve"> <data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>自定义GFWList地址(不需自定义请填空白)</value> <value>227, 12</value>
</data> </data>
<data name="label14.Size" type="System.Drawing.Size, System.Drawing"> <data name="label13.Text" xml:space="preserve">
<value>191, 12</value> <value>自定义GFWList地址(不需自定义请填空白)</value>
</data> </data>
<data name="label14.Text" xml:space="preserve"> <data name="label14.Size" type="System.Drawing.Size, System.Drawing">
<value>自定义DNS(可多个,用逗号(,)隔开)</value> <value>191, 12</value>
</data> </data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing"> <data name="label14.Text" xml:space="preserve">
<value>53, 12</value> <value>自定义DNS(可多个,用逗号(,)隔开)</value>
</data> </data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing"> <data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 12</value> <value>53, 12</value>
</data> </data>
<data name="label16.Text" xml:space="preserve"> <data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>Http代理</value> <value>53, 12</value>
</data> </data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing"> <data name="label16.Text" xml:space="preserve">
<value>77, 12</value> <value>Http代理</value>
</data> </data>
<data name="label2.Text" xml:space="preserve"> <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>本地监听端口</value> <value>77, 12</value>
</data> </data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing"> <data name="label2.Text" xml:space="preserve">
<value>29, 12</value> <value>本地监听端口</value>
</data> </data>
<data name="label3.Text" xml:space="preserve"> <data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>协议</value> <value>29, 12</value>
</data> </data>
<data name="label4.Text" xml:space="preserve"> <data name="label3.Text" xml:space="preserve">
<value>*设置用户PAC规则用逗号(,)隔开</value> <value>协议</value>
</data> </data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing"> <data name="label4.Text" xml:space="preserve">
<value>53, 12</value> <value>*设置用户PAC规则用逗号(,)隔开</value>
</data> </data>
<data name="label5.Text" xml:space="preserve"> <data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>日志等级</value> <value>53, 12</value>
</data> </data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="label5.Text" xml:space="preserve">
<data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib"> <value>日志等级</value>
<value>True</value> </data>
</data> <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing"> <data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib">
<value>5, 49</value> <value>True</value>
</data> </data>
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing"> <data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
<value>383, 12</value> <value>5, 49</value>
</data> </data>
<data name="labRoutingTips.Text" xml:space="preserve"> <data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
<value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value> <value>383, 12</value>
</data> </data>
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing"> <data name="labRoutingTips.Text" xml:space="preserve">
<value>77, 12</value> <value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value>
</data> </data>
<data name="lbFreshrate.Text" xml:space="preserve"> <data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
<value>统计刷新频率</value> <value>77, 12</value>
</data> </data>
<data name="linkLabelRoutingDoc.Text" xml:space="preserve"> <data name="lbFreshrate.Text" xml:space="preserve">
<value>域名解析策略</value> <value>统计刷新频率</value>
</data> </data>
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing"> <data name="linkLabelRoutingDoc.Text" xml:space="preserve">
<value>642, 72</value> <value>域名解析策略</value>
</data> </data>
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing"> <data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
<value>3, 89</value> <value>642, 72</value>
</data> </data>
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing"> <data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
<value>642, 481</value> <value>3, 89</value>
</data> </data>
<data name="tabPage1.Text" xml:space="preserve"> <data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
<value> Core:基础设置 </value> <value>642, 481</value>
</data> </data>
<data name="tabPage2.Text" xml:space="preserve"> <data name="tabPage1.Text" xml:space="preserve">
<value> Core:路由设置 </value> <value> Core:基础设置 </value>
</data> </data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing"> <data name="tabPage2.Text" xml:space="preserve">
<value>634, 455</value> <value> Core:路由设置 </value>
</data> </data>
<data name="tabPage3.Text" xml:space="preserve"> <data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value> 1.代理的Domain或IP </value> <value>634, 455</value>
</data> </data>
<data name="tabPage4.Size" type="System.Drawing.Size, System.Drawing"> <data name="tabPage3.Text" xml:space="preserve">
<value>634, 455</value> <value> 1.代理的Domain或IP </value>
</data> </data>
<data name="tabPage4.Text" xml:space="preserve"> <data name="tabPage4.Size" type="System.Drawing.Size, System.Drawing">
<value> 2.直连的Domain或IP </value> <value>634, 455</value>
</data> </data>
<data name="tabPage5.Size" type="System.Drawing.Size, System.Drawing"> <data name="tabPage4.Text" xml:space="preserve">
<value>634, 455</value> <value> 2.直连的Domain或IP </value>
</data> </data>
<data name="tabPage5.Text" xml:space="preserve"> <data name="tabPage5.Size" type="System.Drawing.Size, System.Drawing">
<value> 3.阻止的Domain或IP </value> <value>634, 455</value>
</data> </data>
<data name="tabPage6.Text" xml:space="preserve"> <data name="tabPage5.Text" xml:space="preserve">
<value> Core:KCP设置 </value> <value> 3.阻止的Domain或IP </value>
</data> </data>
<data name="tabPage7.Text" xml:space="preserve"> <data name="tabPage6.Text" xml:space="preserve">
<value> v2rayN设置 </value> <value> Core:KCP设置 </value>
</data> </data>
<data name="tabPage8.Size" type="System.Drawing.Size, System.Drawing"> <data name="tabPage7.Text" xml:space="preserve">
<value>634, 455</value> <value> v2rayN设置 </value>
</data> </data>
<data name="tabPage8.Text" xml:space="preserve"> <data name="tabPage8.Size" type="System.Drawing.Size, System.Drawing">
<value> 4.预定义规则 </value> <value>634, 455</value>
</data> </data>
<data name="tabPage9.Text" xml:space="preserve"> <data name="tabPage8.Text" xml:space="preserve">
<value> 用户PAC设置 </value> <value> 4.预定义规则 </value>
</data> </data>
<data name="txtUseragent.Size" type="System.Drawing.Size, System.Drawing"> <data name="tabPage9.Text" xml:space="preserve">
<value>628, 449</value> <value> 用户PAC设置 </value>
</data> </data>
<data name="txtUserblock.Size" type="System.Drawing.Size, System.Drawing"> <data name="txtUseragent.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value> <value>628, 449</value>
</data> </data>
<data name="txtUserdirect.Size" type="System.Drawing.Size, System.Drawing"> <data name="txtUserblock.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value> <value>628, 449</value>
</data> </data>
<data name="txtUserdirect.Size" type="System.Drawing.Size, System.Drawing">
<value>628, 449</value>
</data>
</root> </root>

View file

@ -323,9 +323,129 @@ namespace v2rayN.Handler
/// <returns></returns> /// <returns></returns>
private static int outbound(Config config, ref V2rayConfig v2rayConfig) private static int outbound(Config config, ref V2rayConfig v2rayConfig)
{ {
int configIndex = config.index;
Outbounds outbound;
try try
{ {
Outbounds outbound = v2rayConfig.outbounds[0]; if(config.transitEnabled)
{
config.index = config.transitSetting;
outbound = v2rayConfig.outbounds[0];
if (config.configType() == (int)EConfigType.Vmess)
{
VnextItem vnextItem;
if (outbound.settings.vnext.Count <= 0)
{
vnextItem = new VnextItem();
outbound.settings.vnext.Add(vnextItem);
}
else
{
vnextItem = outbound.settings.vnext[0];
}
//远程服务器地址和端口
vnextItem.address = config.address();
vnextItem.port = config.port();
UsersItem usersItem;
if (vnextItem.users.Count <= 0)
{
usersItem = new UsersItem();
vnextItem.users.Add(usersItem);
}
else
{
usersItem = vnextItem.users[0];
}
//远程服务器用户ID
usersItem.id = config.id();
usersItem.alterId = config.alterId();
usersItem.email = Global.userEMail;
usersItem.security = config.security();
//Mux
outbound.mux.enabled = config.muxEnabled;
outbound.mux.concurrency = config.muxEnabled ? 8 : -1;
outbound.protocol = "vmess";
outbound.settings.servers = null;
}
else if (config.configType() == (int)EConfigType.Shadowsocks)
{
ServersItem serversItem;
if (outbound.settings.servers.Count <= 0)
{
serversItem = new ServersItem();
outbound.settings.servers.Add(serversItem);
}
else
{
serversItem = outbound.settings.servers[0];
}
//远程服务器地址和端口
serversItem.address = config.address();
serversItem.port = config.port();
serversItem.password = config.id();
serversItem.method = config.security();
serversItem.ota = false;
serversItem.level = 1;
outbound.mux.enabled = false;
outbound.mux.concurrency = -1;
outbound.protocol = "shadowsocks";
outbound.settings.vnext = null;
}
else if (config.configType() == (int)EConfigType.Socks)
{
ServersItem serversItem;
if (outbound.settings.servers.Count <= 0)
{
serversItem = new ServersItem();
outbound.settings.servers.Add(serversItem);
}
else
{
serversItem = outbound.settings.servers[0];
}
//远程服务器地址和端口
serversItem.address = config.address();
serversItem.port = config.port();
serversItem.method = null;
serversItem.password = null;
if (!Utils.IsNullOrEmpty(config.security())
&& !Utils.IsNullOrEmpty(config.id()))
{
SocksUsersItem socksUsersItem = new SocksUsersItem
{
user = config.security(),
pass = config.id(),
level = 1
};
serversItem.users = new List<SocksUsersItem>() { socksUsersItem };
}
outbound.mux.enabled = false;
outbound.mux.concurrency = -1;
outbound.protocol = "socks";
outbound.settings.vnext = null;
}
outbound = v2rayConfig.outbounds[1];
config.index = configIndex;
}
else
{
v2rayConfig.outbounds.RemoveAt(0);
outbound = v2rayConfig.outbounds[0];
outbound.tag = "proxy";
}
if (config.configType() == (int)EConfigType.Vmess) if (config.configType() == (int)EConfigType.Vmess)
{ {
VnextItem vnextItem; VnextItem vnextItem;

View file

@ -32,6 +32,22 @@ namespace v2rayN.Mode
/// 日志等级 /// 日志等级
/// </summary> /// </summary>
public string loglevel public string loglevel
{
get; set;
}
/// <summary>
/// 允许代理转发
/// </summary>
public bool transitEnabled
{
get; set;
}
/// <summary>
/// 日志等级
/// </summary>
public int transitSetting
{ {
get; set; get; set;
} }

View file

@ -187,6 +187,8 @@ namespace v2rayN.Mode
/// ///
/// </summary> /// </summary>
public Mux mux { get; set; } public Mux mux { get; set; }
public ProxySettings proxySettings { get; set; }
} }
public class Outboundsettings public class Outboundsettings
@ -517,4 +519,12 @@ namespace v2rayN.Mode
public Header header { get; set; } public Header header { get; set; }
} }
public class ProxySettings
{
/// <summary>
///
/// </summary>
public string tag { get; set; }
}
} }

View file

@ -1,85 +1,129 @@
{ {
"log": { "log": {
"access": "", "access": "",
"error": "", "error": "",
"loglevel": "error" "loglevel": "error"
}, },
"log": { "log": {
"access": "Vaccess.log", "access": "Vaccess.log",
"error": "Verror.log", "error": "Verror.log",
"loglevel": "warning" "loglevel": "warning"
}, },
"inbounds": [ "inbounds": [
{ {
"tag": "proxy", "tag": "proxy",
"port": 10808, "port": 10808,
"protocol": "socks", "protocol": "socks",
"listen": "127.0.0.1", "listen": "127.0.0.1",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true "udp": true
}, },
"sniffing": { "sniffing": {
"enabled": true, "enabled": true,
"destOverride": [ "destOverride": [
"http", "http",
"tls" "tls"
] ]
} }
} }
], ],
"outbounds": [{ "outbounds": [
"tag": "proxy", {
"protocol": "vmess", "tag": "proxy",
"settings": { "protocol": "vmess",
"vnext": [{ "settings": {
"address": "v2ray.cool", "vnext": [
"port": 10086, {
"users": [{ "address": "v2ray.cool",
"id": "a3482e88-686a-4a58-8126-99c9df64b7bf", "port": 10086,
"alterId": 64, "users": [
"security": "auto" {
}] "id": "a3482e88-686a-4a58-8126-99c9df64b7bf",
}], "alterId": 64,
"servers": [{ "security": "auto"
"address": "v2ray.cool", }
"method": "chacha20", ]
"ota": false, }
"password": "123456", ],
"port": 10086, "servers": [
"level": 1 {
}] "address": "v2ray.cool",
}, "method": "chacha20",
"streamSettings": { "ota": false,
"network": "tcp" "password": "123456",
}, "port": 10086,
"mux": { "level": 1
"enabled": false }
} ]
}, },
{ "proxySettings": {
"protocol": "freedom", "tag": "transit"
"settings": {}, },
"tag": "direct" "mux": {
}, "enabled": false
{ }
"protocol": "blackhole", },
"tag": "block", {
"settings": { "tag": "transit",
"response": { "protocol": "vmess",
"type": "http" "settings": {
} "vnext": [
} {
} "address": "v2ray.cool",
], "port": 10086,
"routing": { "users": [
"domainStrategy": "IPIfNonMatch", {
"rules": [ "id": "a3482e88-686a-4a58-8126-99c9df64b7bf",
{ "alterId": 64,
"inboundTag": ["api"], "security": "auto"
"outboundTag": "api", }
"type": "field" ]
}
],
"servers": [
{
"address": "v2ray.cool",
"method": "chacha20",
"ota": false,
"password": "123456",
"port": 10086,
"level": 1
}
]
},
"streamSettings": {
"network": "tcp"
},
"mux": {
"enabled": false
}
},
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block",
"settings": {
"response": {
"type": "http"
} }
] }
} }
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
}
]
}
} }