diff --git a/Netch/Controllers/VMessController.cs b/Netch/Controllers/VMessController.cs index fc893f72..82bd271a 100644 --- a/Netch/Controllers/VMessController.cs +++ b/Netch/Controllers/VMessController.cs @@ -121,6 +121,9 @@ namespace Netch.Controllers } }, mux = new Models.Information.VMess.OutboundMux() + { + enabled = server.UseMux + } }, new Models.Information.VMess.Outbounds() { diff --git a/Netch/Forms/Server/Vmess.Designer.cs b/Netch/Forms/Server/Vmess.Designer.cs index cb4fda4b..5c355b46 100644 --- a/Netch/Forms/Server/Vmess.Designer.cs +++ b/Netch/Forms/Server/Vmess.Designer.cs @@ -30,6 +30,7 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VMess)); this.ConfigurationGroupBox = new System.Windows.Forms.GroupBox(); + this.UseMuxCheckBox = new System.Windows.Forms.CheckBox(); this.TLSSecureCheckBox = new System.Windows.Forms.CheckBox(); this.QUICSecretLabel = new System.Windows.Forms.Label(); this.QUICSecurityLabel = new System.Windows.Forms.Label(); @@ -61,6 +62,7 @@ // // ConfigurationGroupBox // + this.ConfigurationGroupBox.Controls.Add(this.UseMuxCheckBox); this.ConfigurationGroupBox.Controls.Add(this.TLSSecureCheckBox); this.ConfigurationGroupBox.Controls.Add(this.QUICSecretLabel); this.ConfigurationGroupBox.Controls.Add(this.QUICSecurityLabel); @@ -86,19 +88,33 @@ this.ConfigurationGroupBox.Controls.Add(this.RemarkTextBox); this.ConfigurationGroupBox.Controls.Add(this.RemarkLabel); this.ConfigurationGroupBox.Controls.Add(this.PortLabel); - this.ConfigurationGroupBox.Location = new System.Drawing.Point(12, 12); + this.ConfigurationGroupBox.Location = new System.Drawing.Point(18, 18); + this.ConfigurationGroupBox.Margin = new System.Windows.Forms.Padding(4); this.ConfigurationGroupBox.Name = "ConfigurationGroupBox"; - this.ConfigurationGroupBox.Size = new System.Drawing.Size(420, 373); + this.ConfigurationGroupBox.Padding = new System.Windows.Forms.Padding(4); + this.ConfigurationGroupBox.Size = new System.Drawing.Size(630, 560); this.ConfigurationGroupBox.TabIndex = 1; this.ConfigurationGroupBox.TabStop = false; this.ConfigurationGroupBox.Text = "Configuration"; // + // UseMuxCheckBox + // + this.UseMuxCheckBox.AutoSize = true; + this.UseMuxCheckBox.Location = new System.Drawing.Point(292, 519); + this.UseMuxCheckBox.Margin = new System.Windows.Forms.Padding(4); + this.UseMuxCheckBox.Name = "UseMuxCheckBox"; + this.UseMuxCheckBox.Size = new System.Drawing.Size(110, 28); + this.UseMuxCheckBox.TabIndex = 25; + this.UseMuxCheckBox.Text = "Use Mux"; + this.UseMuxCheckBox.UseVisualStyleBackColor = true; + // // TLSSecureCheckBox // this.TLSSecureCheckBox.AutoSize = true; - this.TLSSecureCheckBox.Location = new System.Drawing.Point(302, 346); + this.TLSSecureCheckBox.Location = new System.Drawing.Point(453, 519); + this.TLSSecureCheckBox.Margin = new System.Windows.Forms.Padding(4); this.TLSSecureCheckBox.Name = "TLSSecureCheckBox"; - this.TLSSecureCheckBox.Size = new System.Drawing.Size(90, 21); + this.TLSSecureCheckBox.Size = new System.Drawing.Size(127, 28); this.TLSSecureCheckBox.TabIndex = 24; this.TLSSecureCheckBox.Text = "TLS Secure"; this.TLSSecureCheckBox.UseVisualStyleBackColor = true; @@ -106,26 +122,29 @@ // QUICSecretLabel // this.QUICSecretLabel.AutoSize = true; - this.QUICSecretLabel.Location = new System.Drawing.Point(10, 320); + this.QUICSecretLabel.Location = new System.Drawing.Point(15, 480); + this.QUICSecretLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.QUICSecretLabel.Name = "QUICSecretLabel"; - this.QUICSecretLabel.Size = new System.Drawing.Size(79, 17); + this.QUICSecretLabel.Size = new System.Drawing.Size(113, 24); this.QUICSecretLabel.TabIndex = 22; this.QUICSecretLabel.Text = "QUIC Secret"; // // QUICSecurityLabel // this.QUICSecurityLabel.AutoSize = true; - this.QUICSecurityLabel.Location = new System.Drawing.Point(10, 290); + this.QUICSecurityLabel.Location = new System.Drawing.Point(15, 435); + this.QUICSecurityLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.QUICSecurityLabel.Name = "QUICSecurityLabel"; - this.QUICSecurityLabel.Size = new System.Drawing.Size(88, 17); + this.QUICSecurityLabel.Size = new System.Drawing.Size(129, 24); this.QUICSecurityLabel.TabIndex = 20; this.QUICSecurityLabel.Text = "QUIC Security"; // // QUICSecretTextBox // - this.QUICSecretTextBox.Location = new System.Drawing.Point(120, 317); + this.QUICSecretTextBox.Location = new System.Drawing.Point(180, 476); + this.QUICSecretTextBox.Margin = new System.Windows.Forms.Padding(4); this.QUICSecretTextBox.Name = "QUICSecretTextBox"; - this.QUICSecretTextBox.Size = new System.Drawing.Size(294, 23); + this.QUICSecretTextBox.Size = new System.Drawing.Size(439, 31); this.QUICSecretTextBox.TabIndex = 23; this.QUICSecretTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // @@ -134,52 +153,58 @@ this.QUICSecurityComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.QUICSecurityComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.QUICSecurityComboBox.FormattingEnabled = true; - this.QUICSecurityComboBox.Location = new System.Drawing.Point(120, 286); + this.QUICSecurityComboBox.Location = new System.Drawing.Point(180, 429); + this.QUICSecurityComboBox.Margin = new System.Windows.Forms.Padding(4); this.QUICSecurityComboBox.Name = "QUICSecurityComboBox"; - this.QUICSecurityComboBox.Size = new System.Drawing.Size(294, 24); + this.QUICSecurityComboBox.Size = new System.Drawing.Size(439, 32); this.QUICSecurityComboBox.TabIndex = 21; this.QUICSecurityComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); // // PathLabel // this.PathLabel.AutoSize = true; - this.PathLabel.Location = new System.Drawing.Point(10, 260); + this.PathLabel.Location = new System.Drawing.Point(15, 390); + this.PathLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PathLabel.Name = "PathLabel"; - this.PathLabel.Size = new System.Drawing.Size(33, 17); + this.PathLabel.Size = new System.Drawing.Size(49, 24); this.PathLabel.TabIndex = 18; this.PathLabel.Text = "Path"; // // PathTextBox // - this.PathTextBox.Location = new System.Drawing.Point(120, 257); + this.PathTextBox.Location = new System.Drawing.Point(180, 386); + this.PathTextBox.Margin = new System.Windows.Forms.Padding(4); this.PathTextBox.Name = "PathTextBox"; - this.PathTextBox.Size = new System.Drawing.Size(294, 23); + this.PathTextBox.Size = new System.Drawing.Size(439, 31); this.PathTextBox.TabIndex = 19; this.PathTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // HostLabel // this.HostLabel.AutoSize = true; - this.HostLabel.Location = new System.Drawing.Point(10, 231); + this.HostLabel.Location = new System.Drawing.Point(15, 346); + this.HostLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.HostLabel.Name = "HostLabel"; - this.HostLabel.Size = new System.Drawing.Size(35, 17); + this.HostLabel.Size = new System.Drawing.Size(50, 24); this.HostLabel.TabIndex = 16; this.HostLabel.Text = "Host"; // // HostTextBox // - this.HostTextBox.Location = new System.Drawing.Point(120, 228); + this.HostTextBox.Location = new System.Drawing.Point(180, 342); + this.HostTextBox.Margin = new System.Windows.Forms.Padding(4); this.HostTextBox.Name = "HostTextBox"; - this.HostTextBox.Size = new System.Drawing.Size(294, 23); + this.HostTextBox.Size = new System.Drawing.Size(439, 31); this.HostTextBox.TabIndex = 17; this.HostTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // FakeTypeLabel // this.FakeTypeLabel.AutoSize = true; - this.FakeTypeLabel.Location = new System.Drawing.Point(10, 201); + this.FakeTypeLabel.Location = new System.Drawing.Point(15, 302); + this.FakeTypeLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.FakeTypeLabel.Name = "FakeTypeLabel"; - this.FakeTypeLabel.Size = new System.Drawing.Size(67, 17); + this.FakeTypeLabel.Size = new System.Drawing.Size(97, 24); this.FakeTypeLabel.TabIndex = 14; this.FakeTypeLabel.Text = "Fake Type"; // @@ -188,18 +213,20 @@ this.FakeTypeComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.FakeTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.FakeTypeComboBox.FormattingEnabled = true; - this.FakeTypeComboBox.Location = new System.Drawing.Point(120, 197); + this.FakeTypeComboBox.Location = new System.Drawing.Point(180, 296); + this.FakeTypeComboBox.Margin = new System.Windows.Forms.Padding(4); this.FakeTypeComboBox.Name = "FakeTypeComboBox"; - this.FakeTypeComboBox.Size = new System.Drawing.Size(294, 24); + this.FakeTypeComboBox.Size = new System.Drawing.Size(439, 32); this.FakeTypeComboBox.TabIndex = 15; this.FakeTypeComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); // // TransferProtocolLabel // this.TransferProtocolLabel.AutoSize = true; - this.TransferProtocolLabel.Location = new System.Drawing.Point(10, 170); + this.TransferProtocolLabel.Location = new System.Drawing.Point(15, 255); + this.TransferProtocolLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.TransferProtocolLabel.Name = "TransferProtocolLabel"; - this.TransferProtocolLabel.Size = new System.Drawing.Size(109, 17); + this.TransferProtocolLabel.Size = new System.Drawing.Size(156, 24); this.TransferProtocolLabel.TabIndex = 12; this.TransferProtocolLabel.Text = "Transfer Protocol"; // @@ -208,18 +235,20 @@ this.TransferProtocolComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.TransferProtocolComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.TransferProtocolComboBox.FormattingEnabled = true; - this.TransferProtocolComboBox.Location = new System.Drawing.Point(120, 166); + this.TransferProtocolComboBox.Location = new System.Drawing.Point(180, 249); + this.TransferProtocolComboBox.Margin = new System.Windows.Forms.Padding(4); this.TransferProtocolComboBox.Name = "TransferProtocolComboBox"; - this.TransferProtocolComboBox.Size = new System.Drawing.Size(294, 24); + this.TransferProtocolComboBox.Size = new System.Drawing.Size(439, 32); this.TransferProtocolComboBox.TabIndex = 13; this.TransferProtocolComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); // // EncryptMethodLabel // this.EncryptMethodLabel.AutoSize = true; - this.EncryptMethodLabel.Location = new System.Drawing.Point(10, 139); + this.EncryptMethodLabel.Location = new System.Drawing.Point(15, 208); + this.EncryptMethodLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.EncryptMethodLabel.Name = "EncryptMethodLabel"; - this.EncryptMethodLabel.Size = new System.Drawing.Size(101, 17); + this.EncryptMethodLabel.Size = new System.Drawing.Size(150, 24); this.EncryptMethodLabel.TabIndex = 10; this.EncryptMethodLabel.Text = "Encrypt Method"; // @@ -228,102 +257,114 @@ this.EncryptMethodComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.EncryptMethodComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.EncryptMethodComboBox.FormattingEnabled = true; - this.EncryptMethodComboBox.Location = new System.Drawing.Point(120, 135); + this.EncryptMethodComboBox.Location = new System.Drawing.Point(180, 202); + this.EncryptMethodComboBox.Margin = new System.Windows.Forms.Padding(4); this.EncryptMethodComboBox.Name = "EncryptMethodComboBox"; - this.EncryptMethodComboBox.Size = new System.Drawing.Size(294, 24); + this.EncryptMethodComboBox.Size = new System.Drawing.Size(439, 32); this.EncryptMethodComboBox.TabIndex = 11; this.EncryptMethodComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); // // AlterIDLabel // this.AlterIDLabel.AutoSize = true; - this.AlterIDLabel.Location = new System.Drawing.Point(10, 109); + this.AlterIDLabel.Location = new System.Drawing.Point(15, 164); + this.AlterIDLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.AlterIDLabel.Name = "AlterIDLabel"; - this.AlterIDLabel.Size = new System.Drawing.Size(52, 17); + this.AlterIDLabel.Size = new System.Drawing.Size(76, 24); this.AlterIDLabel.TabIndex = 8; this.AlterIDLabel.Text = "Alter ID"; // // AlterIDTextBox // - this.AlterIDTextBox.Location = new System.Drawing.Point(120, 106); + this.AlterIDTextBox.Location = new System.Drawing.Point(180, 159); + this.AlterIDTextBox.Margin = new System.Windows.Forms.Padding(4); this.AlterIDTextBox.Name = "AlterIDTextBox"; - this.AlterIDTextBox.Size = new System.Drawing.Size(54, 23); + this.AlterIDTextBox.Size = new System.Drawing.Size(79, 31); this.AlterIDTextBox.TabIndex = 9; this.AlterIDTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // UserIDLabel // this.UserIDLabel.AutoSize = true; - this.UserIDLabel.Location = new System.Drawing.Point(10, 80); + this.UserIDLabel.Location = new System.Drawing.Point(15, 120); + this.UserIDLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.UserIDLabel.Name = "UserIDLabel"; - this.UserIDLabel.Size = new System.Drawing.Size(52, 17); + this.UserIDLabel.Size = new System.Drawing.Size(72, 24); this.UserIDLabel.TabIndex = 6; this.UserIDLabel.Text = "User ID"; // // UserIDTextBox // - this.UserIDTextBox.Location = new System.Drawing.Point(120, 77); + this.UserIDTextBox.Location = new System.Drawing.Point(180, 116); + this.UserIDTextBox.Margin = new System.Windows.Forms.Padding(4); this.UserIDTextBox.Name = "UserIDTextBox"; - this.UserIDTextBox.Size = new System.Drawing.Size(294, 23); + this.UserIDTextBox.Size = new System.Drawing.Size(439, 31); this.UserIDTextBox.TabIndex = 7; this.UserIDTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // PortTextBox // - this.PortTextBox.Location = new System.Drawing.Point(360, 48); + this.PortTextBox.Location = new System.Drawing.Point(540, 72); + this.PortTextBox.Margin = new System.Windows.Forms.Padding(4); this.PortTextBox.Name = "PortTextBox"; - this.PortTextBox.Size = new System.Drawing.Size(54, 23); + this.PortTextBox.Size = new System.Drawing.Size(79, 31); this.PortTextBox.TabIndex = 5; this.PortTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // AddressTextBox // - this.AddressTextBox.Location = new System.Drawing.Point(120, 48); + this.AddressTextBox.Location = new System.Drawing.Point(180, 72); + this.AddressTextBox.Margin = new System.Windows.Forms.Padding(4); this.AddressTextBox.Name = "AddressTextBox"; - this.AddressTextBox.Size = new System.Drawing.Size(234, 23); + this.AddressTextBox.Size = new System.Drawing.Size(349, 31); this.AddressTextBox.TabIndex = 3; this.AddressTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // AddressLabel // this.AddressLabel.AutoSize = true; - this.AddressLabel.Location = new System.Drawing.Point(10, 51); + this.AddressLabel.Location = new System.Drawing.Point(15, 76); + this.AddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.AddressLabel.Name = "AddressLabel"; - this.AddressLabel.Size = new System.Drawing.Size(56, 17); + this.AddressLabel.Size = new System.Drawing.Size(80, 24); this.AddressLabel.TabIndex = 2; this.AddressLabel.Text = "Address"; // // RemarkTextBox // - this.RemarkTextBox.Location = new System.Drawing.Point(120, 19); + this.RemarkTextBox.Location = new System.Drawing.Point(180, 28); + this.RemarkTextBox.Margin = new System.Windows.Forms.Padding(4); this.RemarkTextBox.Name = "RemarkTextBox"; - this.RemarkTextBox.Size = new System.Drawing.Size(294, 23); + this.RemarkTextBox.Size = new System.Drawing.Size(439, 31); this.RemarkTextBox.TabIndex = 1; this.RemarkTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // RemarkLabel // this.RemarkLabel.AutoSize = true; - this.RemarkLabel.Location = new System.Drawing.Point(10, 22); + this.RemarkLabel.Location = new System.Drawing.Point(15, 33); + this.RemarkLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.RemarkLabel.Name = "RemarkLabel"; - this.RemarkLabel.Size = new System.Drawing.Size(53, 17); + this.RemarkLabel.Size = new System.Drawing.Size(76, 24); this.RemarkLabel.TabIndex = 0; this.RemarkLabel.Text = "Remark"; // // PortLabel // this.PortLabel.AutoSize = true; - this.PortLabel.Location = new System.Drawing.Point(353, 51); + this.PortLabel.Location = new System.Drawing.Point(530, 76); + this.PortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.PortLabel.Name = "PortLabel"; - this.PortLabel.Size = new System.Drawing.Size(11, 17); + this.PortLabel.Size = new System.Drawing.Size(14, 24); this.PortLabel.TabIndex = 4; this.PortLabel.Text = ":"; // // ControlButton // - this.ControlButton.Location = new System.Drawing.Point(357, 391); + this.ControlButton.Location = new System.Drawing.Point(536, 586); + this.ControlButton.Margin = new System.Windows.Forms.Padding(4); this.ControlButton.Name = "ControlButton"; - this.ControlButton.Size = new System.Drawing.Size(75, 23); + this.ControlButton.Size = new System.Drawing.Size(112, 34); this.ControlButton.TabIndex = 2; this.ControlButton.Text = "Save"; this.ControlButton.UseVisualStyleBackColor = true; @@ -331,15 +372,15 @@ // // VMess // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(444, 426); + this.ClientSize = new System.Drawing.Size(666, 639); this.Controls.Add(this.ControlButton); this.Controls.Add(this.ConfigurationGroupBox); this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6); this.MaximizeBox = false; this.Name = "VMess"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; @@ -381,5 +422,6 @@ private System.Windows.Forms.Label QUICSecretLabel; private System.Windows.Forms.CheckBox TLSSecureCheckBox; private System.Windows.Forms.Button ControlButton; + private System.Windows.Forms.CheckBox UseMuxCheckBox; } } \ No newline at end of file diff --git a/Netch/Forms/Server/Vmess.cs b/Netch/Forms/Server/Vmess.cs index adfb7fb2..199e26f1 100644 --- a/Netch/Forms/Server/Vmess.cs +++ b/Netch/Forms/Server/Vmess.cs @@ -55,6 +55,7 @@ namespace Netch.Forms.Server QUICSecurityLabel.Text = Utils.i18N.Translate("QUIC Security"); QUICSecretLabel.Text = Utils.i18N.Translate("QUIC Secret"); TLSSecureCheckBox.Text = Utils.i18N.Translate("TLS Secure"); + UseMuxCheckBox.Text = Utils.i18N.Translate("Use Mux"); ControlButton.Text = Utils.i18N.Translate("Save"); foreach (var encrypt in Global.EncryptMethods.VMess) @@ -92,6 +93,7 @@ namespace Netch.Forms.Server QUICSecurityComboBox.SelectedIndex = Global.EncryptMethods.VMessQUIC.IndexOf(Global.Settings.Server[Index].QUICSecure); QUICSecretTextBox.Text = Global.Settings.Server[Index].QUICSecret; TLSSecureCheckBox.Checked = Global.Settings.Server[Index].TLSSecure; + UseMuxCheckBox.Checked = Global.Settings.Server[Index].UseMux; } else { @@ -126,7 +128,8 @@ namespace Netch.Forms.Server Path = PathTextBox.Text, QUICSecure = QUICSecurityComboBox.Text, QUICSecret = QUICSecretTextBox.Text, - TLSSecure = TLSSecureCheckBox.Checked + TLSSecure = TLSSecureCheckBox.Checked, + UseMux = UseMuxCheckBox.Checked }); } else @@ -146,7 +149,8 @@ namespace Netch.Forms.Server Path = PathTextBox.Text, QUICSecure = QUICSecurityComboBox.Text, QUICSecret = QUICSecretTextBox.Text, - TLSSecure = TLSSecureCheckBox.Checked + TLSSecure = TLSSecureCheckBox.Checked, + UseMux = UseMuxCheckBox.Checked }; } diff --git a/Netch/Models/Information/VMess.cs b/Netch/Models/Information/VMess.cs index 86c63914..32133e67 100644 --- a/Netch/Models/Information/VMess.cs +++ b/Netch/Models/Information/VMess.cs @@ -139,7 +139,7 @@ namespace Netch.Models.Information public class OutboundMux { - public bool enabled = true; + public bool enabled = false; } public class StreamSettings diff --git a/Netch/Models/Server.cs b/Netch/Models/Server.cs index 675621b2..7d952725 100644 --- a/Netch/Models/Server.cs +++ b/Netch/Models/Server.cs @@ -128,6 +128,11 @@ namespace Netch.Models /// public bool TLSSecure = false; + /// + /// Mux 多路复用(VMess) + /// + public bool UseMux = false; + /// /// 延迟 /// diff --git a/Netch/Models/VMess.cs b/Netch/Models/VMess.cs index 63bf96f4..22c9550f 100644 --- a/Netch/Models/VMess.cs +++ b/Netch/Models/VMess.cs @@ -5,6 +5,14 @@ /// public class VMess { + /// + /// Mux Class + /// + public class Mux + { + public object enabled; + } + /// /// 链接版本 /// @@ -59,5 +67,10 @@ /// 是否使用 TLS /// public string tls; + + /// + /// Mux 多路复用 + /// + public Mux mux; } } diff --git a/Netch/Resources/zh-CN b/Netch/Resources/zh-CN index 9c4a6942..0a51c944 100644 --- a/Netch/Resources/zh-CN +++ b/Netch/Resources/zh-CN @@ -41,6 +41,7 @@ "QUIC Security": "QUIC 加密方式", "QUIC Secret": "QUIC 加密密钥", "TLS Secure": "TLS 底层传输安全", + "Use Mux": "Mux 多路复用", "Encrypt Method": "加密方式", "Protocol": "协议", "Protocol Param": "协议参数", diff --git a/Netch/Utils/ShareLink.cs b/Netch/Utils/ShareLink.cs index 42f248d0..ffdf864c 100644 --- a/Netch/Utils/ShareLink.cs +++ b/Netch/Utils/ShareLink.cs @@ -482,6 +482,26 @@ namespace Netch.Utils } data.TLSSecure = vmess.tls == "tls"; + if (vmess.mux == null) + { + data.UseMux = false; + } + else + { + if (vmess.mux.enabled is Boolean) + { + data.UseMux = (bool)vmess.mux.enabled; + } + else if (vmess.mux.enabled is String) + { + data.UseMux = (string)vmess.mux.enabled == "true"; // 针对使用字符串当作布尔值的情况 + } + else + { + data.UseMux = false; + } + } + data.EncryptMethod = "auto"; // V2Ray 加密方式不包括在链接中,主动添加一个 list.Add(data);