mirror of
https://github.com/proxysu/ProxySU.git
synced 2024-11-21 20:56:08 +03:00
review add add grpc
This commit is contained in:
parent
5948ca6efd
commit
379edc265f
@ -129,6 +129,25 @@ namespace ProxySU_Core.Models.Developers
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(wsInbound));
|
||||
}
|
||||
|
||||
if(parameters.Types.Contains(XrayType.VLESS_gRPC))
|
||||
{
|
||||
var gRPCInBound = GetBound("VLESS_gRPC.json");
|
||||
gRPCInBound.port = parameters.VLESS_gRPC_Port;
|
||||
gRPCInBound.settings.clients[0].id = parameters.UUID;
|
||||
gRPCInBound.streamSettings.grpcSettings.serviceName = parameters.VLESS_gRPC_ServiceName;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(gRPCInBound));
|
||||
}
|
||||
|
||||
if(parameters.Types.Contains(XrayType.VLESS_KCP))
|
||||
{
|
||||
var kcpBound = GetBound("VLESS_KCP.json");
|
||||
kcpBound.port = parameters.VLESS_KCP_Port;
|
||||
kcpBound.settings.clients[0].id = parameters.UUID;
|
||||
kcpBound.streamSettings.kcpSettings.header.type = parameters.VLESS_KCP_Type;
|
||||
kcpBound.streamSettings.kcpSettings.seed = parameters.VLESS_KCP_Seed;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(kcpBound));
|
||||
}
|
||||
|
||||
if (parameters.Types.Contains(XrayType.VMESS_TCP))
|
||||
{
|
||||
var mtcpBound = GetBound("VMESS_TCP.json");
|
||||
@ -159,6 +178,16 @@ namespace ProxySU_Core.Models.Developers
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(mwsBound));
|
||||
}
|
||||
|
||||
if (parameters.Types.Contains(XrayType.VMESS_KCP))
|
||||
{
|
||||
var kcpBound = GetBound("VMESS_KCP.json");
|
||||
kcpBound.port = parameters.VMESS_KCP_Port;
|
||||
kcpBound.settings.clients[0].id = parameters.UUID;
|
||||
kcpBound.streamSettings.kcpSettings.header.type = parameters.VMESS_KCP_Type;
|
||||
kcpBound.streamSettings.kcpSettings.seed = parameters.VMESS_KCP_Seed;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(kcpBound));
|
||||
}
|
||||
|
||||
if (parameters.Types.Contains(XrayType.Trojan_TCP))
|
||||
{
|
||||
var trojanTcpBound = GetBound("Trojan_TCP.json");
|
||||
@ -172,16 +201,6 @@ namespace ProxySU_Core.Models.Developers
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(trojanTcpBound));
|
||||
}
|
||||
|
||||
if (parameters.Types.Contains(XrayType.VMESS_KCP))
|
||||
{
|
||||
var kcpBound = GetBound("VMESS_KCP.json");
|
||||
kcpBound.port = parameters.VMESS_KCP_Port;
|
||||
kcpBound.settings.clients[0].id = parameters.UUID;
|
||||
kcpBound.streamSettings.kcpSettings.header.type = parameters.VMESS_KCP_Type;
|
||||
kcpBound.streamSettings.kcpSettings.seed = parameters.VMESS_KCP_Seed;
|
||||
xrayConfig.inbounds.Add(JToken.FromObject(kcpBound));
|
||||
}
|
||||
|
||||
|
||||
if (parameters.Types.Contains(XrayType.ShadowsocksAEAD))
|
||||
{
|
||||
|
@ -135,6 +135,13 @@ namespace ProxySU_Core.Models
|
||||
_headerType = settings.VLESS_KCP_Type;
|
||||
_seed = settings.VLESS_KCP_Seed;
|
||||
_port = settings.VLESS_KCP_Port;
|
||||
_descriptiveText = "vless-mKCP";
|
||||
break;
|
||||
case XrayType.VLESS_gRPC:
|
||||
_protocol = "vless";
|
||||
_type = "grpc";
|
||||
_path = settings.VLESS_gRPC_ServiceName;
|
||||
_descriptiveText = "vless-gRPC";
|
||||
break;
|
||||
case XrayType.Trojan_TCP:
|
||||
_protocol = "trojan";
|
||||
|
@ -17,15 +17,17 @@ namespace ProxySU_Core.Models
|
||||
{
|
||||
var guid = Guid.NewGuid().ToString();
|
||||
Port = 443;
|
||||
VLESS_KCP_Port = 10445;
|
||||
VMESS_KCP_Port = 10443;
|
||||
ShadowSocksPort = 11443;
|
||||
VLESS_KCP_Port = 2001;
|
||||
VLESS_gRPC_Port = 2002;
|
||||
VMESS_KCP_Port = 3001;
|
||||
ShadowSocksPort = 4001;
|
||||
|
||||
UUID = guid;
|
||||
Types = new List<XrayType>();
|
||||
|
||||
VLESS_WS_Path = "/vlessws";
|
||||
VLESS_H2_Path = "/vlessh2";
|
||||
VLESS_gRPC_ServiceName = "xray_gRPC";
|
||||
|
||||
VMESS_WS_Path = "/vmessws";
|
||||
VMESS_TCP_Path = "/vmesstcp";
|
||||
@ -45,18 +47,6 @@ namespace ProxySU_Core.Models
|
||||
/// </summary>
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless kcp端口
|
||||
/// </summary>
|
||||
public int VLESS_KCP_Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vmess kcp端口
|
||||
/// </summary>
|
||||
public int VMESS_KCP_Port { get; set; }
|
||||
|
||||
// ss端口
|
||||
public int ShadowSocksPort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UUID
|
||||
@ -64,6 +54,8 @@ namespace ProxySU_Core.Models
|
||||
public string UUID { get; set; }
|
||||
|
||||
#region vless
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// vless ws路径
|
||||
/// </summary>
|
||||
@ -83,6 +75,22 @@ namespace ProxySU_Core.Models
|
||||
/// vless kcp type
|
||||
/// </summary>
|
||||
public string VLESS_KCP_Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vless kcp端口
|
||||
/// </summary>
|
||||
public int VLESS_KCP_Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// grpc service name
|
||||
/// </summary>
|
||||
public string VLESS_gRPC_ServiceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// grpc port
|
||||
/// </summary>
|
||||
public int VLESS_gRPC_Port { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region vmess
|
||||
@ -110,6 +118,11 @@ namespace ProxySU_Core.Models
|
||||
/// vmess kcp type
|
||||
/// </summary>
|
||||
public string VMESS_KCP_Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vmess kcp端口
|
||||
/// </summary>
|
||||
public int VMESS_KCP_Port { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Trojan
|
||||
@ -134,6 +147,11 @@ namespace ProxySU_Core.Models
|
||||
/// ss method
|
||||
/// </summary>
|
||||
public string ShadowsocksMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ss端口
|
||||
/// </summary>
|
||||
public int ShadowSocksPort { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
@ -194,6 +212,7 @@ namespace ProxySU_Core.Models
|
||||
VLESS_WS = 102,
|
||||
VLESS_H2 = 103,
|
||||
VLESS_KCP = 104,
|
||||
VLESS_gRPC = 110,
|
||||
|
||||
// vmess 201开头
|
||||
VMESS_TCP = 201,
|
||||
|
@ -183,9 +183,18 @@
|
||||
<Compile Include="Views\RecordEditor\ServerInfoControl.xaml.cs">
|
||||
<DependentUpon>ServerInfoControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\RecordEditor\ShadowSocksEditorControl.xaml.cs">
|
||||
<DependentUpon>ShadowSocksEditorControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\RecordEditor\TrojanEditorControl.xaml.cs">
|
||||
<DependentUpon>TrojanEditorControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\RecordEditor\VlessEditorControl.xaml.cs">
|
||||
<DependentUpon>VlessEditorControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\RecordEditor\VmessEditorControl.xaml.cs">
|
||||
<DependentUpon>VmessEditorControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\TerminalWindow.xaml.cs">
|
||||
<DependentUpon>TerminalWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -286,6 +295,7 @@
|
||||
<None Include="Templates\xray\server\05_inbounds\Trojan_WS.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Templates\xray\server\05_inbounds\VLESS_gRPC.json" />
|
||||
<None Include="Templates\xray\server\05_inbounds\VLESS_HTTP2.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
@ -391,10 +401,22 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\RecordEditor\ShadowSocksEditorControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\RecordEditor\TrojanEditorControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\RecordEditor\VlessEditorControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\RecordEditor\VmessEditorControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\TerminalWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"port": 2002,
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": ""
|
||||
}
|
||||
],
|
||||
"decryption": "none"
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "grpc",
|
||||
"grpcSettings": {
|
||||
"serviceName": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -188,6 +188,9 @@ namespace ProxySU_Core.ViewModels
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// VMESS
|
||||
/// </summary>
|
||||
public partial class XraySettingsViewModel
|
||||
{
|
||||
// vmess tcp
|
||||
@ -267,7 +270,9 @@ namespace ProxySU_Core.ViewModels
|
||||
public List<string> KcpTypes => _kcpTypes;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// VLESS
|
||||
/// </summary>
|
||||
public partial class XraySettingsViewModel
|
||||
{
|
||||
|
||||
@ -345,10 +350,10 @@ namespace ProxySU_Core.ViewModels
|
||||
}
|
||||
public bool Checked_VLESS_KCP
|
||||
{
|
||||
get => settings.Types.Contains(XrayType.VMESS_KCP);
|
||||
get => settings.Types.Contains(XrayType.VLESS_KCP);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.VMESS_KCP);
|
||||
CheckBoxChanged(value, XrayType.VLESS_KCP);
|
||||
Notify("Checked_VLESS_KCP");
|
||||
}
|
||||
}
|
||||
@ -356,6 +361,31 @@ namespace ProxySU_Core.ViewModels
|
||||
{
|
||||
get => ShareLink.Build(XrayType.VLESS_KCP, settings);
|
||||
}
|
||||
|
||||
// vless grpc
|
||||
public string VLESS_gRPC_ServiceName
|
||||
{
|
||||
get => settings.VLESS_gRPC_ServiceName;
|
||||
set => settings.VLESS_gRPC_ServiceName = value;
|
||||
}
|
||||
public int VLESS_gRPC_Port
|
||||
{
|
||||
get => settings.VLESS_gRPC_Port;
|
||||
set => settings.VLESS_gRPC_Port = value;
|
||||
}
|
||||
public bool Checked_VLESS_gRPC
|
||||
{
|
||||
get => settings.Types.Contains(XrayType.VLESS_gRPC);
|
||||
set
|
||||
{
|
||||
CheckBoxChanged(value, XrayType.VLESS_gRPC);
|
||||
Notify("Checked_VLESS_gRPC");
|
||||
}
|
||||
}
|
||||
public string VLESS_gRPC_ShareLink
|
||||
{
|
||||
get => ShareLink.Build(XrayType.VLESS_gRPC, settings);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -42,13 +42,13 @@
|
||||
<local:VlessEditorControl />
|
||||
</TabItem>
|
||||
<TabItem metro:HeaderedControlHelper.HeaderFontSize="20" Padding="10,5,10,5" Header="VMESS">
|
||||
|
||||
<local:VmessEditorControl />
|
||||
</TabItem>
|
||||
<TabItem metro:HeaderedControlHelper.HeaderFontSize="20" Padding="10,5,10,5" Header="Trojan">
|
||||
|
||||
<local:TrojanEditorControl />
|
||||
</TabItem>
|
||||
<TabItem metro:HeaderedControlHelper.HeaderFontSize="20" Padding="10,5,10,5" Header="ShadowSocks">
|
||||
|
||||
<local:ShadowSocksEditorControl />
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
|
@ -0,0 +1,63 @@
|
||||
<UserControl x:Class="ProxySU_Core.Views.RecordEditor.ShadowSocksEditorControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ProxySU_Core.Views.RecordEditor"
|
||||
xmlns:converters="clr-namespace:ProxySU_Core.Converters"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<converters:VisibleConverter x:Key="VisibleConverter" />
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="220" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<CheckBox Content="ShadowSocksAEAD
SS,支持udp。"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
FontSize="13"
|
||||
Style="{StaticResource MahApps.Styles.CheckBox}"
|
||||
IsChecked="{Binding Path=Settings.CheckedShadowSocks}" />
|
||||
|
||||
<StackPanel Margin="50,0,0,10"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Settings.CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="SS 密码" Width="80" VerticalAlignment="Bottom" />
|
||||
<TextBox Text="{Binding Path=Settings.ShadowSocksPassword}"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="200"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Margin="50,0,0,10"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Settings.CheckedShadowSocks,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="SS 加密方式" Width="80" VerticalAlignment="Bottom" />
|
||||
<ComboBox Width="200"
|
||||
VerticalAlignment="Bottom"
|
||||
ItemsSource="{Binding Settings.ShadowSocksMethods}"
|
||||
SelectedValue="{Binding Settings.ShadowSocksMethod}">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ProxySU_Core.Views.RecordEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// ShadowSocksEditorControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ShadowSocksEditorControl : UserControl
|
||||
{
|
||||
public ShadowSocksEditorControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
45
ProxySU_Core/Views/RecordEditor/TrojanEditorControl.xaml
Normal file
45
ProxySU_Core/Views/RecordEditor/TrojanEditorControl.xaml
Normal file
@ -0,0 +1,45 @@
|
||||
<UserControl x:Class="ProxySU_Core.Views.RecordEditor.TrojanEditorControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ProxySU_Core.Views.RecordEditor"
|
||||
xmlns:converters="clr-namespace:ProxySU_Core.Converters"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<converters:VisibleConverter x:Key="VisibleConverter" />
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="220" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<CheckBox Content="Trojan over TCP with TLS
Trojan"
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
FontSize="13"
|
||||
Style="{StaticResource MahApps.Styles.CheckBox}"
|
||||
IsChecked="{Binding Path=Settings.Checked_Trojan_TCP}" />
|
||||
|
||||
<StackPanel Margin="50,0,0,10"
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Settings.Checked_Trojan_TCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="Trojan密码" Width="70" VerticalAlignment="Bottom" />
|
||||
<TextBox Text="{Binding Path=Settings.TrojanPassword}"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="260" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
28
ProxySU_Core/Views/RecordEditor/TrojanEditorControl.xaml.cs
Normal file
28
ProxySU_Core/Views/RecordEditor/TrojanEditorControl.xaml.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ProxySU_Core.Views.RecordEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// TrojanEditorControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TrojanEditorControl : UserControl
|
||||
{
|
||||
public TrojanEditorControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
@ -24,6 +24,8 @@
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--XTLS-->
|
||||
@ -49,12 +51,19 @@
|
||||
Style="{StaticResource MahApps.Styles.CheckBox}"
|
||||
IsChecked="{Binding Path=Settings.Checked_VLESS_WS}" />
|
||||
|
||||
<!--mKCP-->
|
||||
<CheckBox Content="VLESS mKCP
游戏推荐,延迟低。"
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource MahApps.Styles.CheckBox}"
|
||||
IsChecked="{Binding Path=Settings.Checked_VLESS_KCP}" />
|
||||
|
||||
<!--gRPC-->
|
||||
<CheckBox Content="VLESS gRPC
基于http2,多路复用。"
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource MahApps.Styles.CheckBox}"
|
||||
IsChecked="{Binding Path=Settings.Checked_VLESS_gRPC}"/>
|
||||
|
||||
|
||||
|
||||
@ -125,10 +134,27 @@
|
||||
<TextBox Text="{Binding Path=Settings.VLESS_KCP_Port}" Width="100" VerticalAlignment="Bottom" />
|
||||
</StackPanel>
|
||||
|
||||
<!--xray prot-->
|
||||
<!--gRPC Port-->
|
||||
<StackPanel Margin="40,0,0,10"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Settings.Checked_VLESS_gRPC,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="gRPC端口" Width="70" VerticalAlignment="Bottom" />
|
||||
<TextBox Text="{Binding Path=Settings.VLESS_gRPC_Port}" Width="100" VerticalAlignment="Bottom" />
|
||||
|
||||
<Label Content="服务器" Width="70" VerticalAlignment="Bottom" Margin="10,0,0,0" />
|
||||
<TextBox Text="{Binding Path=Settings.VLESS_gRPC_ServiceName}" Width="100" VerticalAlignment="Bottom" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<!--xray prot-->
|
||||
<StackPanel Margin="40,0,0,10"
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="Xray端口" Width="70" VerticalAlignment="Bottom" />
|
||||
<TextBox Text="{Binding Path=Settings.Port}" Width="100" VerticalAlignment="Bottom" />
|
||||
|
134
ProxySU_Core/Views/RecordEditor/VmessEditorControl.xaml
Normal file
134
ProxySU_Core/Views/RecordEditor/VmessEditorControl.xaml
Normal file
@ -0,0 +1,134 @@
|
||||
<UserControl x:Class="ProxySU_Core.Views.RecordEditor.VmessEditorControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ProxySU_Core.Views.RecordEditor"
|
||||
xmlns:converters="clr-namespace:ProxySU_Core.Converters"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<converters:VisibleConverter x:Key="VisibleConverter" />
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="220"/>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--TCP-->
|
||||
<CheckBox Content="VMESS over TCP with TLS
不推荐"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
FontSize="13"
|
||||
Style="{StaticResource MahApps.Styles.CheckBox}"
|
||||
IsChecked="{Binding Path=Settings.Checked_VMESS_TCP}" />
|
||||
|
||||
<!--WebSocket-->
|
||||
<CheckBox Content="VMESS over WS with TLS
推荐,支持CDN。"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource MahApps.Styles.CheckBox}"
|
||||
IsChecked="{Binding Path=Settings.Checked_VMESS_WS}" />
|
||||
|
||||
<!--mKCP-->
|
||||
<CheckBox Content="VMESS mKCP
游戏推荐,延迟低。"
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource MahApps.Styles.CheckBox}"
|
||||
IsChecked="{Binding Path=Settings.Checked_VMESS_KCP}" />
|
||||
|
||||
|
||||
|
||||
<!--************************** 参数 **************************-->
|
||||
|
||||
<!--UUID-->
|
||||
<StackPanel Margin="40,0,0,10"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="UUID" Width="70" VerticalAlignment="Bottom" />
|
||||
|
||||
<TextBox Text="{Binding Path=Settings.UUID}"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="260" />
|
||||
|
||||
<Button Style="{StaticResource MahApps.Styles.Button.Flat}"
|
||||
Margin="5,0,0,0"
|
||||
Height="30"
|
||||
VerticalAlignment="Bottom"
|
||||
Command="{Binding Path=Settings.RandomUuid}"
|
||||
Content="随机" />
|
||||
</StackPanel>
|
||||
|
||||
<!--Domain-->
|
||||
<StackPanel Margin="40,0,0,10"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="域名" Width="70" VerticalAlignment="Bottom" />
|
||||
<TextBox Text="{Binding Path=Settings.Domain}" Width="260" VerticalAlignment="Bottom" />
|
||||
</StackPanel>
|
||||
|
||||
<!--Mask Domain-->
|
||||
<StackPanel Margin="40,0,0,10"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="伪装域名" Width="70" VerticalAlignment="Bottom" />
|
||||
<TextBox Text="{Binding Path=Settings.MaskDomain}" Width="260" VerticalAlignment="Bottom" />
|
||||
</StackPanel>
|
||||
|
||||
<!--WebSocket Path-->
|
||||
<StackPanel Margin="40,0,0,10"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Settings.Checked_VMESS_WS,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="WS路径" Width="70" VerticalAlignment="Bottom" />
|
||||
<TextBox Text="{Binding Path=Settings.VMESS_WS_Path}"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="260" />
|
||||
</StackPanel>
|
||||
|
||||
<!--kcp port-->
|
||||
<StackPanel Margin="40,0,0,10"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{
|
||||
Binding Path=Settings.Checked_VMESS_KCP,
|
||||
Converter={StaticResource VisibleConverter}
|
||||
}">
|
||||
<Label Content="KCP端口" Width="70" VerticalAlignment="Bottom" />
|
||||
<TextBox Text="{Binding Path=Settings.VMESS_KCP_Port}" Width="100" VerticalAlignment="Bottom" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<!--xray prot-->
|
||||
<StackPanel Margin="40,0,0,10"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Orientation="Horizontal">
|
||||
<Label Content="Xray端口" Width="70" VerticalAlignment="Bottom" />
|
||||
<TextBox Text="{Binding Path=Settings.Port}" Width="100" VerticalAlignment="Bottom" />
|
||||
<Label Content="默认端口443,不建议修改" VerticalAlignment="Bottom" Foreground="Red" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
28
ProxySU_Core/Views/RecordEditor/VmessEditorControl.xaml.cs
Normal file
28
ProxySU_Core/Views/RecordEditor/VmessEditorControl.xaml.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ProxySU_Core.Views.RecordEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// VmessEditorControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class VmessEditorControl : UserControl
|
||||
{
|
||||
public VmessEditorControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user